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
 

 

xml generate in separate lines

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

New User


Joined: 24 Aug 2007
Posts: 38
Location: chennai

PostPosted: Wed Jan 09, 2008 10:56 am    Post subject: xml generate in separate lines
Reply with quote

Hi,
I am generating an XML. The code is shown.

Code:
WORKING-STORAGE SECTION.                                   
 01  EMPLOYEE.                                             
     05  EMPLOYEE-ID                  PIC 9(5) VALUE 0.     
     05  PREMIUM-AMOUNT               PIC 9(5) VALUE 0.     
 01  WS-XML-OUTPUT                    PIC X(100).           
PROCEDURE DIVISION.                                         
0000-MAINLINE.                                             
     MOVE '16838' TO EMPLOYEE.                             
     XML GENERATE WS-XML-OUTPUT                             
         FROM EMPLOYEE                                     
     END-XML.                                               
     DISPLAY WS-XML-OUTPUT.                                 
     STOP RUN.                                             
0000-EXIT.     


I am getting the output as

<EMPLOYEE><EMPLOYEE-ID>16838</EMPLOYEE-ID><PREMIUM-AMOUNT> </PREMIUM-AMOUNT></EMPLOYEE>

My requirement is to generate output in this format:

<EMPLOYEE>
<EMPLOYEE-ID>16838</EMPLOYEE-ID>
<PREMIUM-AMOUNT> </PREMIUM-AMOUNT>
</EMPLOYEE>

Is there any COBOL statement/function by which i can generate it like this.
Can anyone please help to generate XML in this format?
Back to top
View user's profile Send private message

stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Wed Jan 09, 2008 6:26 pm    Post subject:
Reply with quote

IBM has one on their site they call it Pretty or something like that.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Wed Jan 09, 2008 6:28 pm    Post subject:
Reply with quote

Basically it involves re-parsing your generated XML to put the breaks in. You can see they are adding indents as needed to make it really pretty.

http://publib.boulder.ibm.com/infocenter/iadthelp/v7r0/index.jsp?topic=/com.ibm.etools.iseries.pgmgd.doc/c0925405254.htm
Back to top
View user's profile Send private message
sanil m

New User


Joined: 24 Aug 2007
Posts: 38
Location: chennai

PostPosted: Thu Jan 10, 2008 12:41 pm    Post subject: Reply to: xml generate in separate lines
Reply with quote

Thanx for posting!!!!.....
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts Generate Cohort report using SORT Indrajit_57 SYNCSORT 6 Wed Jun 01, 2016 9:41 am


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