Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 1542
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: 10358
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: 1542
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 Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Updating multiple counts in trailer!! Vignesh Sid SYNCSORT 4 Mon Nov 06, 2017 1:04 pm
No new posts Selecting a row from multiple tables! Vignesh Sid DB2 2 Thu Oct 26, 2017 6:09 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us