IBM Mainframe Forum Index
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in

JSON in cobol 6.1

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

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

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 --

DISPLAY 'JSON ......:' json-text

output as below --

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

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 All times are GMT + 6 Hours
Forum Index -> COBOL Programming
Page 1 of 1


Search our Forum:

Similar Topics
Topic Forum Replies
No new posts JCL for replacing code in Cobol JCL & VSAM 8
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
No new posts XML Parsing in COBOL creating "h... COBOL Programming 0
No new posts Calling Rexx program from Cobol CLIST & REXX 12
This topic is locked: you cannot edit posts or make replies. Missing Negative sign in COBOL COBOL Programming 6

Back to Top