IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Unexpected token parsing JSON value using HWTJPARS


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mtv.sbo

New User


Joined: 07 Mar 2017
Posts: 2
Location: Brazil

PostPosted: Fri May 24, 2019 8:29 pm
Reply with quote

Hi,

I have a program in PL/I that handle a JSON file and it's working fine today.

It calls the function HWTJPARS to parse the json.

But now the JSON file will contain array and the program ends in error because of the brackets [] from the array. The reason text from the function is: "Unexpected token parsing JSON value at offset 212"
Any suggestions?

Here is a sample of the part of the JSON:
"name":{"isInterval":false,"options":["Tony","Steve"]}
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri May 24, 2019 11:51 pm
Reply with quote

Square brackets are not part of the EBCDIC invariant character set. The ones you see may not be the ones the JSON parser expects.
Back to top
View user's profile Send private message
mtv.sbo

New User


Joined: 07 Mar 2017
Posts: 2
Location: Brazil

PostPosted: Sat May 25, 2019 12:36 am
Reply with quote

prino wrote:
Square brackets are not part of the EBCDIC invariant character set. The ones you see may not be the ones the JSON parser expects.


Hi, thanks for the response. Do you have any suggestions ?
Maybe I need convert the json before call the function, or there is a character in EBCDIC that represents the [] ?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Sat May 25, 2019 1:44 am
Reply with quote

You're in Brazil, so (probably) using codepage 037/1140, with "[" & "]" encoded as 0xBA and 0xBB. My wild (educated) guess is that the JSON parser uses another codepage, possibly 1047 where they are encoded as 0xAD and 0xBD...

See en.wikipedia.org/wiki/EBCDIC_code_pages
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts DFHPI1008 JSON generation failed COBOL Programming 0
No new posts Parsing Large JSON file using COBOL COBOL Programming 4
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts COBOL to JSON COBOL Programming 1
No new posts parsing with startat and endbefr SYNCSORT 10
Search our Forums:

Back to Top