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
 

 

Mapping b/w XML data and Cobol copy book

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

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Thu Jul 12, 2012 2:33 pm    Post subject: Mapping b/w XML data and Cobol copy book
Reply with quote

Hi,

I have a req to map the XML data with COBOL copybook. I have read a xml msg and parsed the script. I want to map the xml data to cobol copybook.

I need a guidance to map fields and occurance fields.


ex:

<firstname>SAMLPE</firstname> ==> this should be map to

firstname pic x(20).

XML Script
<CUSTOMER-DETAILS><CUSTOMER-NAME><FIRSTNAME>rrrrrrrrrrrrr</FIRSTNAME><LASTNAME>yyyyyyyyyyyy</LASTNAME></CUSTOMER-NAME><ADDRESS-DETAILS><CITY>CHENNAI</CITY><STATE>TAMILNADU</STATE></ADDRESS-DETAILS><ADDRESS-DETAILS><CITY>SALEM</CITY><STATE>TAMILNADU</STATE></ADDRESS-DETAILS></CUSTOMER-DETAILS>


Need to be map as below

firstname pic x(20)
lastname pic x(20)
addresss occurs 3 times
city pic x(10)
state pic x(15)
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7996
Location: Bellevue, IA

PostPosted: Thu Jul 12, 2012 4:45 pm    Post subject:
Reply with quote

Are you using XML PARSE in COBOL? If so, have you looked at the output of the XML PARSE? If so, then you know there is no "mapping" involved -- you identify each field, then you move it to the appropriate COBOL variable name -- field by field by field.

If not, then there's a link to Manuals at the top of this page. Start by reading the COBOL Language Reference manual on the XML PARSE statement, then do some testing to see how it works.
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 Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


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