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

XML Generate - Hierarchy of the Output File


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

New User


Joined: 12 May 2007
Posts: 9
Location: arizona

PostPosted: Tue Jul 28, 2015 2:13 am
Reply with quote

I am new at using the XML Generate statement.
Input layout is as follows:
01 noattso.
05 na-bko PIC XXX.
05 na-bro PIC XXX.
05 na-cuso PIC X(7).
05 na-lno PIC X(4).
05 na-nam1o PIC X(36).
05 na-nam2o PIC X(36).
05 na-nam3o PIC X(36).
05 na-nam4o PIC X(36).
05 na-nam5o PIC X(36).
05 na-rate PIC SV9(7).
05 na-org PIC S9(09)V99.

01 xml-out.
05 xml-out-rec PIC X(1000) VALUE SPACES.

Procedure Division Chunk:
XML GENERATE xml-out FROM
noattso
COUNT IN WS-COUNT
ON EXCEPTION
DISPLAY 'PROGRAM XML1: XML GENERATE FAILED'

Output file currently is producted as follows:
<noattso><na-bko>503</na-bko><na-bro>387</na-bro><na-cuso>0257502........

Question: Is there a way to preserve the input hierarchy (each field on its on line) of noattso and produce an output file such as:
<noattso>
<na-bko>503</na-bko>
<na-bro>387</na-bro>
cuso>0257502
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8569
Location: Dubuque, Iowa, USA

PostPosted: Tue Jul 28, 2015 3:47 am
Reply with quote

If you read the syntax diagram for XML GENERATE in the Enterprise COBOL Language Reference manual, you will find that XML GENERATE works to produce a single output variable. If you want anything else, it is NOT XML and you will have to produce it by parsing the output variable after the XML GENERATE is complete.
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 Get two files from one file with diff... DFSORT/ICETOOL 10
No new posts View GDG data which is copied from a ... JCL & VSAM 2
No new posts How to read unpacked field created in... DFSORT/ICETOOL 11
No new posts How to add 2 digits to COMP-3 file? DFSORT/ICETOOL 11
No new posts VSAM file Storage Calculation JCL & VSAM 3
Search our Forums:

Back to Top