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

Using XML GENERATE in COBOL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat May 07, 2011 5:49 am
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 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