Reading Json Data using Data-INTO
Posted: Wed Aug 04, 2021 7:35 pm
Issue - I don't get any data in DATA DS other then "title" field (title field is getting populated correctly. Am i missing something??
JSON -
RPG Declaration -
I am moving the data into a standalone character variable name JsonString (using it below in Data-INTO)
Statement -.
JSON -
Code: Select all
{
"data": {
"instruction2": "FIRST SEAT",
"seat1l3": "2356",
"reset34": "Yes",
"temp": "-78",
"seat1l4": "326",
"seat2l3": "3265",
"instruction1": "** Daily Check Call **",
"seat2l4": "986",
"trl": "12345",
"seat2a70": "253",
"seat1a70": "895",
"eta": "2021-08-18T11:23:24-07:00",
"onsched": "Yes",
"hub": "896586",
"odo": "123658",
"reasonoffsched": "traffic"
},
"title": "Daily Check Call - 01"
}
Code: Select all
dcl-ds data qualified;
instruction2 char(50);
seat1l3 char(5);
reset34 char(1);
temp char(3);
seat1l4 char(5);
seat2l3 char(5);
instruction1 char(50);
seat2l4 char(5);
trl char(6);
seat2a70 char(5);
seat1a70 char(5);
eta char(26);
onsched char(1);
hub char(7);
odo char(11);
reasonoffsched char(70);
title char(50);
end-ds;
Statement -
Code: Select all
Data-into data %Data(JsonString:'doc=string allowextra=yes allowmissing=yes'') %PARSER('YAJLINTO');