Hi, running a simple test for digesting REST API return data using DATA-INTO and YAJL. I have the following code. I've been at this for 14 hours now so I'm kind of hard stuck.
I'm getting error "not matching rpg variables "** and I'm not understanding how come
The json data is wrapped around a {} = Dcl-ds Err_Ds
Then inside it is object errors = Dcl-ds errors ;
Inside errors I got code and message = code int(3); message Varchar(999) Dim(999) ;
I already have allowextra=yes and case=convert, I don't see why it would fail at all
I'm getting error "not matching rpg variables "** and I'm not understanding how come
The json data is wrapped around a {} = Dcl-ds Err_Ds
Then inside it is object errors = Dcl-ds errors ;
Inside errors I got code and message = code int(3); message Varchar(999) Dim(999) ;
I already have allowextra=yes and case=convert, I don't see why it would fail at all
Code:
dcl-ds Err_Ds Qualified; Dcl-ds errors ; code Int(3) ; message Varchar(999) Dim(999) ; END-DS; END-DS; myJSON = '{ + "errors": { + "code": 404, + "message": [ + "Some kind of error message" + ] + } + } ' ; data-into Error_Ds %DATA(myJSON:'case=convert allowextra=yes') %PARSER('YAJLINTO');
Comment