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

xml generate in separate lines


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

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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Generate random number from range of ... COBOL Programming 3
No new posts I need a 4 lines block where substrin... DFSORT/ICETOOL 12
No new posts Copy few lines from SYSOUT of 10 mill... All Other Mainframe Topics 5
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
No new posts Merge 2 lines based on Space from a S... DFSORT/ICETOOL 5
Search our Forums:

Back to Top