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 to COBOL copybook format

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

New User


Joined: 16 Mar 2005
Posts: 23

PostPosted: Wed Oct 21, 2009 8:04 pm    Post subject: XML to COBOL copybook format
Reply with quote

Hi,
I required converting the incoming XML to a COBOL copybook format.
Here is in more detail:
Eg:
Copybook layout:
Code:
05  PAYMENTDATAILS.
     07 SENDERINFO.
         10 NAME                           PIC   X(35).
         10 ADDRESS.
             15 ADD1                      PIC   X(35).
             15 ADD2                      PIC   X(35).
             15 ADD3                      PIC   X(35).
     07 RECEIVERINFO.
         10 NAME                          PIC   X(35).
         10 ADDRESS.
             15 ADD1                      PIC   X(35).
             15 ADD2                      PIC   X(35).
             15 ADD3                      PIC   X(35).
 
Code'd

Incoming XML data:

<PAYMENTDATAILS><SENDERINFO><NAME>Advith</NAME><ADDRESS><ADD1>h.no:10,street1</ADD1><ADD2>location1</ADD2><ADD3>place1</ADD3></ADDRESS></SENDERINFO><RECEIVERINFO><NAME>Kiran</NAME><ADDRESS><ADD1>Plotno:10,sri villa</ADD1><ADD3>place1</ADD3></ADDRESS></RECEIVERINFO></PAYMENTDATAILS>

Note: all the information is not much, there are few optional fileds ew mandatory fields. So they may or may not send us all the optional fields.
We should be handling in moving that to corresponding COBOL copybook field.

I would do this with XML PARSE and with EVALUATE WHEN. But here the field id's are not unique and the number of fields are about 1600 to be formatted.

Pls suggest me is there any simpler way to do this task, also let me know for any further information required.

Thanks much in advance,
Anna
Back to top
View user's profile Send private message

advith001

New User


Joined: 16 Mar 2005
Posts: 23

PostPosted: Wed Oct 21, 2009 10:24 pm    Post subject:
Reply with quote

Adding to the above, I can even get the level count and string the field ids to one string, say

after concatinating all the above group levels, I would be having like below in to working storage field

NAME OF SENDERINFO OF PAYMENT DETAILS
ADD1 OF ADDRESS OF SENDERINFO OF PAYMENT

like wise we can even construct the field to be moved in, but that concatinated string will be in a field, but I'm not sure how could we be make a MOVE statement to the value of the concatinated string..

I might be confusing here.. but the requirement is very clear in the above msg, here is of one of the thought I got in my mind... icon_smile.gif
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 How to pick only YYMMDD from DATE1P (... atulbaviskar SYNCSORT 7 Wed Mar 22, 2017 11:39 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm


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