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: 8057
Location: East Dubuque, Illinois, USA

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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm


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