View previous topic :: View next topic
|
Author |
Message |
advith001
New User
Joined: 16 Mar 2005 Posts: 23
|
|
|
|
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 |
|
|
advith001
New User
Joined: 16 Mar 2005 Posts: 23
|
|
|
|
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... |
|
Back to top |
|
|
|