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

Mapping b/w XML data and Cobol copy book


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 12, 2012 4:45 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top