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 XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts Search utility(3.14) using JCl and Cobol RKS3 COBOL Programming 12 Sat Jun 10, 2017 10:24 pm
No new posts Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am


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