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

Processing XML with multiple same-tag values


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri Feb 01, 2013 5:01 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Feb 01, 2013 5:19 pm
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

Global Moderator


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

PostPosted: Fri Feb 01, 2013 6:13 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top