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

JSON in cobol 6.1


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srikant314

New User


Joined: 26 Oct 2016
Posts: 5
Location: INDIA

PostPosted: Wed Jan 22, 2020 5:39 pm
Reply with quote

Hello team,

We have recently migrated to cobol 6.1 from 4.2 cobol version.
Now when I excute the below code I get a junk output. If anyone can assist me here.

Group variable declaration

Code:
01 G.                                   
   05 h.                               
      10 a pic x(10) Value 'Eh?'.       
      10 3_ pic 9 Value 5.             
      10 C-c pic x(10) Value 'See'.



In the main section I have put in the below code --

Code:
JSON GENERATE json-text FROM G   
DISPLAY 'JSON ......:' json-text

output as below --

Code:
JSON ……: #    #   #  /               '''


You should know by now that you should use the code tags to present code and data. I've done it for you this time. In future do it yourself.
Back to top
View user's profile Send private message
shyamkumar15

New User


Joined: 29 Jan 2020
Posts: 1
Location: India

PostPosted: Wed Jan 29, 2020 12:12 pm
Reply with quote

You need to use MOVE FUNCTION DISPLAY-OF(FUNCTION NATIONAL-OF(GROUP VARIABLE (1:LENGTH OF GROUP) 1208)) to display in valid characters.
Also to use national variable you must compile with DBCS option.
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top