Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Using XML GENERATE in COBOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ssurendran

New User


Joined: 09 Jan 2006
Posts: 1

PostPosted: Sat May 07, 2011 1:37 am    Post subject: Using XML GENERATE in COBOL
Reply with quote

I am trying to create an XML file from a COBOL program using the XML GENERATE function . My program would run on Mainframe Z/OS

There appears to be one limitation though
COBOL structure
01 EMPLOYEE.
05 ID PIC X(1).
05 NAME PIC X(10.
05 DEPT PIC X(10).

XML GENERATE will create all sub elements
<employee>
<id>1</id>
<name>xyz</name>
<dept>abc</dept>
</employee>

XML GENERATE WITH ATTRIBUTES will create all attributes
<employee id="1" name="xyz" dept="abc">
</employee>

Is there a way we can somehow indicate that some sub group items should be attributes and some sub elements
<employee id="1">
<name>xyz</name>
<dept>abc</dept>
</employee>
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Sat May 07, 2011 5:49 am    Post subject: Re: Using XML GENERATE in COBOL
Reply with quote

Look it up in the Programming Guide. Only elementary items will be attributes, group items not. However, all your group items will have to have attributes, so you'll have to see if that suits your purposes. Check it out yourself, as I've not done this, just got it from the manual.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us