Rajesh Karunakaran
Programmer
Hi friends,
I downloaded the nfJson library from gitHub and the provided examples PRG files are working properly.
I have a json file, from which I want to retrieve data and populate a cursor. I have seen a PRG in nfJson 'nfopenjson.prg'. The example provided for that prg works fine. However, when I try to apply that to a slightly different structured json file, I am getting 'Syntax error' message.
Below is the content of the JSON file:
Below is the program that I am trying:
I am just checking with retrieving only 2 columns. But, when I run this, I am getting 'Syntax error'.
Can anyone help me to find out the problem? What I am missing?
Thank you very much in advance,
Rajesh
I downloaded the nfJson library from gitHub and the provided examples PRG files are working properly.
I have a json file, from which I want to retrieve data and populate a cursor. I have seen a PRG in nfJson 'nfopenjson.prg'. The example provided for that prg works fine. However, when I try to apply that to a slightly different structured json file, I am getting 'Syntax error' message.
Below is the content of the JSON file:
Code:
{
"master" : {
"decRef" : {
"msgTyp" : "F",
"prtofRptng" : "INNSA1",
"jobNo" : 12345,
"jobDt" : "20190806",
"rptngEvent" : "SAM",
"mnfstNoRotnNo" : 175912,
"mnfstDtRotnDt" : "20190716",
"vesselTypMvmt" : "FI"
}
}
}
Below is the program that I am trying:
Code:
lcJson = FILETOSTR('sampleValues.json')
=nfOpenJson(lcJson,'$.array', ' ;
- msgTyp v(1) $.master.msgTyp ;
- prtofRptng v(20) $.master.prtofRptng')
BROWSE
I am just checking with retrieving only 2 columns. But, when I run this, I am getting 'Syntax error'.
Can anyone help me to find out the problem? What I am missing?
Thank you very much in advance,
Rajesh