Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Unexpected token parsing JSON value using HWTJPARS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Unexpected token parsing JSON value using HWTJPARS
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: 1165
Location: Vilnius, Lithuania

PostPosted: Fri May 24, 2019 11:51 pm    Post subject:
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    Post subject:
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: 1165
Location: Vilnius, Lithuania

PostPosted: Sat May 25, 2019 1:44 am    Post subject:
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 https://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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Parsing single liner XML into readabl... rohanthengal COBOL Programming 1 Fri Oct 18, 2019 8:41 pm
No new posts Need help in parsing record in VBA file guptae DFSORT/ICETOOL 4 Fri Oct 11, 2019 2:31 pm
No new posts Converting a copybook value into Json... srikant314 COBOL Programming 1 Mon Jun 03, 2019 11:17 am
No new posts COBOL - JSON GENERATE husni1972 COBOL Programming 1 Fri Aug 17, 2018 3:29 am
No new posts Convert rows and column into JSON for... Dinesh Manivannan DB2 2 Sun Sep 03, 2017 6:50 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us