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

XML to COBOL copybook format


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top