using xml namespace in cobol program

Ask/Clarify the quesstions about XML, Parsing XML thru enterprise COBOL, etc..

Moderator: Moderator Group

Post Reply
tpkumar77
Member
Posts: 16
Joined: Mon Jul 13, 2009 1:01 am

using xml namespace in cobol program

Post by tpkumar77 » Wed Dec 23, 2009 11:20 pm

Hi

I am using Enterprise COBOL for z/OS 3.4.1.

I have a requirement where in I have to generate an XML file from a flat file.

I have coded the pgm and now the client wants the o/p to be in below format



<oo:confirmReqType xmlns:oo="http://BS_ABC/so/BS_ABC"><AILHEADER><CLIENTID>xxx</CLIENTID></AILHEADER><DOSSIER><DOSSNR>xxxxxxx</DOSSNR><_AE_DOSSIER_STATUS><_AE_CREATIE_DATUM>2009-12-01</_AE_CREATIE_DATUM></_AE_DOSSIER_STATUS><CONTRACT_POLIS><NUMMER>123456789012345</NUMMER><PRODUCT>xxx</PRODUCT><_AE_PARTIJCONTRACTROL><_AE_PARTIJ_VOLGNUM>1</_AE_PARTIJ_VOLGNUM><ENTITEI>VP</ENTITEI><VOLGNUM>1</VOLGNUM></_AE_PARTIJCONTRACTROL></_AE_PERSOON><_AE_ADRES><VOLGNUM >2</VOLGNUM ><PLAATS>Den Haag</PLAATS></_AE_ADRES></PARTIJ><PARTIJ ><VOLGNUM >2</VOLGNUM ><ANAAM >Tester</ANAAM ><TELNUM>0701231234</TELNUM><EMAIL>abc@xyz.com</EMAIL><_AE_ROL>VP</_AE_ROL><_AE_PERSOON ><GEBDAT >1950-01-01</GEBDAT ><GESLACH >M</GESLACH ><TOENAAM >de</TOENAAM ><VOORL >A</VOORL ></_AE_PERSOON ><_AE_ADRES ><VOLGNUM >1</VOLGNUM ><HUISNR > 123</HUISNR ><PCODE >1234AA</PCODE ><PLAATS >Den Haag</PLAATS ><STRAAT>Teststraat</STRAAT><TOEVOEG>a</TOEVOEG><_AE_ADRES_INT><LANDOMS>?</LANDOMS></_AE_ADRES_INT></_AE_ADRES ></PARTIJ ></DOSSIER></oo:confReqType>

I am able to get the entire data except the bold portion.

Could any one pls tell me how can I generate xmlns:oo="http://BS_ABC/so/BS_ABC">[above code ( I could not use the namespace option with XML Generate ,as am using 3.x version of Cobol)
I came across the info that we can use namespace option with GENERATE XML command with cobol ver 4.x and above,but not for versions below 4.
Please..advice..
Regards,
Kumar

tpkumar77
Member
Posts: 16
Joined: Mon Jul 13, 2009 1:01 am

Post by tpkumar77 » Thu Dec 24, 2009 11:31 pm

Thanks frnds.. i got the solution for this query.
I just used MOVE stmt with Ref modification to acheive this.
Regards,
Kumar

Anuj Dhawan
Moderator
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Tue Dec 29, 2009 8:08 pm

Thanks for keeping us posted, hope this solution will help some one in near future...:)
Regards,
Anuj

academyindia4

Topic deleted by Admin

Post by academyindia4 » Wed Feb 03, 2016 11:09 pm

<< Content deleted By Admin >>

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others