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.
<firstname>SAMLPE</firstname> ==> this should be map to
firstname pic x(20).
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)
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.