Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Reformatting and adding additional fi... Badbeef SYNCSORT 6 Thu Apr 05, 2018 4:45 pm
No new posts How to Generate JCL using Sort naveen katkuri DFSORT/ICETOOL 7 Tue Mar 13, 2018 3:50 pm
No new posts write multiple lines in PS file in cobol Balu5491 COBOL Programming 7 Wed Mar 07, 2018 10:27 am
No new posts PARSE GDG name to separate generation... Abid Hasan SYNCSORT 2 Sun Feb 11, 2018 3:40 pm
No new posts XML Generate with Attribute & Ele... Log Thangavel COBOL Programming 5 Fri Jan 19, 2018 6:21 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us