I received this .json validation error response to an API POST
[
{
"success": false,
"data": null,
"statusSet": [
{
"code": 100,
"descriptor": "Required",
"message": "LoadNumber required",
"field": "LoadNumber"
}
]
}
]
I used Scott's YAJLGEN command to generate this data structure
dcl-ds errType2 qualified dim(5);
num_errType2 int(10) inz(0);
success ind;
data varchar(5) inz('');
num_statusSet int(10) inz(0);
dcl-ds statusSet dim(10);
code packed(7) inz(0);
descriptor varchar(15) inz('');
message varchar(128) inz('');
field varchar(9) inz('');
end-ds;
end-ds;
As generated, 'num-errType2...' preceded the dcl-ds, but this caused a compile error RNF5347, An assignment operator is expected with the EVAL operation.
Here is the code I am using to process the response
for i = 1 to errType2.num_ErrType2;
for j = 1 to errType2.num_statusSet;
srcDta = errType2.statusSet(j).message + crlf;
write emailbody msgBody;
endfor;
endfor;
I am getting compile error RNF5343, Array ERRTYPE2 has too many omitted indexes at lines 'for i = 1 ...', 'for j = 1 ...', and 'srcDta = ...'.
I'm stumped. Can anyone help?
[
{
"success": false,
"data": null,
"statusSet": [
{
"code": 100,
"descriptor": "Required",
"message": "LoadNumber required",
"field": "LoadNumber"
}
]
}
]
I used Scott's YAJLGEN command to generate this data structure
dcl-ds errType2 qualified dim(5);
num_errType2 int(10) inz(0);
success ind;
data varchar(5) inz('');
num_statusSet int(10) inz(0);
dcl-ds statusSet dim(10);
code packed(7) inz(0);
descriptor varchar(15) inz('');
message varchar(128) inz('');
field varchar(9) inz('');
end-ds;
end-ds;
As generated, 'num-errType2...' preceded the dcl-ds, but this caused a compile error RNF5347, An assignment operator is expected with the EVAL operation.
Here is the code I am using to process the response
for i = 1 to errType2.num_ErrType2;
for j = 1 to errType2.num_statusSet;
srcDta = errType2.statusSet(j).message + crlf;
write emailbody msgBody;
endfor;
endfor;
I am getting compile error RNF5343, Array ERRTYPE2 has too many omitted indexes at lines 'for i = 1 ...', 'for j = 1 ...', and 'srcDta = ...'.
I'm stumped. Can anyone help?
Comment