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
 
Processing XML with multiple same-tag values

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

New User


Joined: 11 Jul 2012
Posts: 5
Location: Republic of Ireland

PostPosted: Fri Feb 01, 2013 4:48 pm    Post subject: Processing XML with multiple same-tag values
Reply with quote

I have a similar problem to this and the sample described above is not clear to me.

We're looking to process a PAIN.001 XML message. This is an ISO standard for payment processing, i.e. we can't amend tag values.

Code:

   <document>
      <CstmrCdtTrfInitn>
         <GrpHdr>
            <MsgId>XXXXXXXX</MsgId>
            <CreDtTm>XXXXXXXX</CreDtTm>
            <NbOfTxs>1</NbOfTxs>
            <CtrlSum>123.45</CtrlSum>
            <InitgPty>
               <Nm>XXXXXXXX</Nm>
               <Id>
                  <OrgId>
                     <BICOrBEI>XXXXXXXX</BICOrBEI>
                  </OrgId>
               </Id>
            </InitgPty>
         </GrpHdr>
         <PmtInf>
            <PmtInfId>XXXXXXXX</PmtInfId>
            <PmtMtd>TRF</PmtMtd>
            <BtchBookg>false</BtchBookg>
            <NbOfTxs>1</NbOfTxs>
            <CtrlSum>123.45</CtrlSum>
            <PmtTpInf>
               <InstrPrty>NORM</InstrPrty>
               <SvcLvl>
                  <Cd>XXXXXXXX</Cd>
               </SvcLvl>
            </PmtTpInf>
            <ReqdExctnDt>XXXXXXXX</ReqdExctnDt>
            <Dbtr>
               <Nm>XXXXXXXX</Nm>
               <Id>
                  <OrgId>
                     <BICOrBEI>XXXXXXXX</BICOrBEI>
                  </OrgId>
               </Id>
            </Dbtr>
            <DbtrAcct>
               <Id>
                  <IBAN>IE99AAAA99999999999999</IBAN>
               </Id>
            </DbtrAcct>


My issue is how to get to the <IBAN> value shown three lines from the end of the sample above.

1. Although not shown in the sample, the tag <IBAN> is not unique in the message; there's a second value for the Creditor side of the payment. This is true for other values too (i.e. tags not unique in message).

2. Can the tag IBAN be addressed in 1 PARSE statement, or do I need to issue successive PARSE statements to step my way down the hierarchy ? If one, how, e.g. do I concatenate the preceding hierarchical tag values ?

We have very little experience of XML on the mainframe in this site and nothing that has had to handle a message with this structure.

Thank you
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1539
Location: Andromeda Galaxy

PostPosted: Fri Feb 01, 2013 5:01 pm    Post subject:
Reply with quote

My dear Feargal

Be pretty careful when you ask details about some ISO formats which is risky

Better always tag with someother words a continent might be watching your post
Back to top
View user's profile Send private message
Feargal FitzPatrick

New User


Joined: 11 Jul 2012
Posts: 5
Location: Republic of Ireland

PostPosted: Fri Feb 01, 2013 5:05 pm    Post subject:
Reply with quote

Eh, thank you icon_confused.gif ?

The reason for referring to ISO was to clarify that we cannot control the tag values used, i.e. referring to <DbtrIBAN> or <CdtrIBAN> is not an option.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10293
Location: italy

PostPosted: Fri Feb 01, 2013 5:19 pm    Post subject: Reply to: Processing XML with multiple same-tag values
Reply with quote

Quote:
Be pretty careful when you ask details about some ISO formats which is risky


why ???
ISO specifications are <freely> available so talking about them is not a legal problem

if somebody has to implement the standards he/she/it has to know about them

the only thing to be careful about is when posting excerpts/quotes from the documentation
IIRC the ISO <documentation> is not completely free so misquoting, quoting too much
might result in some kind of copyright violation

still small quotes can be posted under the fair use assumption
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1539
Location: Andromeda Galaxy

PostPosted: Fri Feb 01, 2013 6:13 pm    Post subject:
Reply with quote

Standards are freely available but when he mentioned IBAN or BIC details just wanted to ensure he doesnt give actual data

I wanted to edit it before but couldnt
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 Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 4 Tue Jul 25, 2017 12:12 am
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


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