XML output stage in 8.1 is unnecessarily grouping elements

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

XML output stage in 8.1 is unnecessarily grouping elements

Post by parag.s.27 »

All,

I have a task where I have a complex set of repeating elements that are expected in the XML message going to MQ. I have been trying for 2 days now but I am seeing that for the complex repeating elements, the value is automatically getting deduped - grouoped even though the trigger column is something else.

For e.g.

The input records are: -

Code: Select all

Row1 PartyID: 123456789, prevRR: H, CuRR: H, Hierarchy: TK, H1party: L063969385, H1RR: S, H1Ind: N
Row2 PartyID: 26789456, prevRR: H, CuRR: H, Hierarchy: TK, H1party: L063969385, H1RR: S, H1Ind: N
Row2 PartyID: 987654321, prevRR: H, CuRR: H, Hierarchy: TK, H1party: L063969385, H1RR: S, H1Ind: N
My requirement is to get the output as: -
: -

Code: Select all

<ns1:OR>
	<ns1:ORParty TransactionType="C">
		<ns2:PartyIdTypeCode>PTY_ID</ns2:PartyIdTypeCode>
		<ns2:PartyId>123456789</ns2:PartyId>
	</ns1:ORParty>
	<ns1:ORPreviousRR>H</ns1:ORPreviousRR>
	<ns1:ORCurrentRR>H</ns1:ORCurrentRR>
	<ns1:ORHierarchy>TK</ns1:ORHierarchy>
</ns1:OR>
<ns1:OR>
	<ns1:ORParty TransactionType="C">
		<ns2:PartyIdTypeCode>PTY_ID</ns2:PartyIdTypeCode>
		<ns2:PartyId>26789456</ns2:PartyId>
	</ns1:ORParty>
	<ns1:ORPreviousRR>H</ns1:ORPreviousRR>
	<ns1:ORCurrentRR>H</ns1:ORCurrentRR>
	<ns1:ORHierarchy>TK</ns1:ORHierarchy>
</ns1:OR>
<ns1:OR>
	<ns1:ORParty TransactionType="C">
		<ns2:PartyIdTypeCode>PTY_ID</ns2:PartyIdTypeCode>
		<ns2:PartyId>987654321</ns2:PartyId>
	</ns1:ORParty>
	<ns1:ORPreviousRR>H</ns1:ORPreviousRR>
	<ns1:ORCurrentRR>H</ns1:ORCurrentRR>
	<ns1:ORHierarchy>TK</ns1:ORHierarchy>
</ns1:OR>
<ns1:H1>
	<ns1:H1Party TransactionType="C">
		<ns2:PartyIdTypeCode>ProfileId</ns2:PartyIdTypeCode>
		<ns2:PartyId>L063969385</ns2:PartyId>
	</ns1:H1Party>
	<ns1:H1ChannelCd>19</ns1:H1ChannelCd>
	<ns1:H1RR>S</ns1:H1RR>
	<ns1:H1ProfileDate>2015-06-12</ns1:H1ProfileDate>
	<ns1:H1Ind>N</ns1:H1Ind>
</ns1:H1>
I am trying to achieve by simply mapping the columns and setting up the property as "TRIGGER COLUMN: H1PARTYID" to group by the H1PARTYID.

However when I see the payload, I am getting it as: -

Code: Select all

<ns1:OR>
	<ns1:ORParty TransactionType="C">
		<ns2:PartyIdTypeCode>PTY_ID</ns2:PartyIdTypeCode>
		<ns2:PartyId>123456789</ns2:PartyId>
	</ns1:ORParty>
	<ns1:ORParty TransactionType="C">
		<ns2:PartyIdTypeCode>PTY_ID</ns2:PartyIdTypeCode>
		<ns2:PartyId>26789456</ns2:PartyId>
	</ns1:ORParty>	
	<ns1:ORParty TransactionType="C">
		<ns2:PartyIdTypeCode>PTY_ID</ns2:PartyIdTypeCode>
		<ns2:PartyId>987654321</ns2:PartyId>
	</ns1:ORParty>	
	<ns1:ORPreviousRR>H</ns1:ORPreviousRR>
	<ns1:ORCurrentRR>H</ns1:ORCurrentRR>
	<ns1:ORHierarchy>TK</ns1:ORHierarchy>
</ns1:OR>
<ns1:H1>
	<ns1:H1Party TransactionType="C">
		<ns2:PartyIdTypeCode>ProfileId</ns2:PartyIdTypeCode>
		<ns2:PartyId>L063969385</ns2:PartyId>
	</ns1:H1Party>
	<ns1:H1ChannelCd>19</ns1:H1ChannelCd>
	<ns1:H1RR>S</ns1:H1RR>
	<ns1:H1ProfileDate>2015-06-12</ns1:H1ProfileDate>
	<ns1:H1Ind>N</ns1:H1Ind>
</ns1:H1>
So here I am not understanding why this is happening. Can anyone suggest any past experience. I have tried many things like, defining keys to sorting to checking the BestPractice document on Kduke's web page.
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just want to point out that the Trigger Column has nothing to do with 'grouping'. It is simply a value that - when it changes - forces a change in output filename, closing the current file and opening a new one.
-craig

"You can never have too many knives" -- Logan Nine Fingers
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Hard to say exactly, but first, definitely use Aggregate, not trigger, put your "key" in the PartyID element, and create a counter upstream that uniquely separates each of the OR elements. They are identical. Force them not to be. Add a fourth column (your counter) that makes sure that they are unique. Give it the same xpath but with its own element name (dummyCounter or something).

See if that gives you the structure you are looking for.....

....then send the xml content downstream to have that dummy column zapped out of it in a Transformer.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Post by parag.s.27 »

Hi,

I cannot use aggregate because the H1Party Node which is the key, repeats with each ORParty (repeating element) element. My requirement is to have the H1 party node appearing only once which cannot happen in Aggregate becuase it will create those many business Payload nodes.

So I get something like this: -

Code: Select all

<ns1: Payload>
<ns1:OR> 
   <ns1:ORParty TransactionType="C"> 
      <ns2:PartyIdTypeCode>PTY_ID</ns2:PartyIdTypeCode> 
      <ns2:PartyId>123456789</ns2:PartyId> 
   </ns1:ORParty> 
   <ns1:ORPreviousRR>H</ns1:ORPreviousRR> 
   <ns1:ORCurrentRR>H</ns1:ORCurrentRR> 
   <ns1:ORHierarchy>TK</ns1:ORHierarchy> 
</ns1:OR> 
<ns1:H1> 
   <ns1:H1Party TransactionType="C"> 
      <ns2:PartyIdTypeCode>ProfileId</ns2:PartyIdTypeCode> 
      <ns2:PartyId>L063969385</ns2:PartyId> 
   </ns1:H1Party> 
   <ns1:H1ChannelCd>19</ns1:H1ChannelCd> 
   <ns1:H1RR>S</ns1:H1RR> 
   <ns1:H1ProfileDate>2015-06-12</ns1:H1ProfileDate> 
   <ns1:H1Ind>N</ns1:H1Ind> 
</ns1:H1>
</ns1: Payload>
<ns1: Payload>
<ns1:OR> 
   <ns1:ORParty TransactionType="C"> 
      <ns2:PartyIdTypeCode>PTY_ID</ns2:PartyIdTypeCode> 
      <ns2:PartyId>987654321</ns2:PartyId> 
   </ns1:ORParty> 
   <ns1:ORPreviousRR>H</ns1:ORPreviousRR> 
   <ns1:ORCurrentRR>H</ns1:ORCurrentRR> 
   <ns1:ORHierarchy>TK</ns1:ORHierarchy> 
</ns1:OR> 
<ns1:H1> 
   <ns1:H1Party TransactionType="C"> 
      <ns2:PartyIdTypeCode>ProfileId</ns2:PartyIdTypeCode> 
      <ns2:PartyId>L063969385</ns2:PartyId> 
   </ns1:H1Party> 
   <ns1:H1ChannelCd>19</ns1:H1ChannelCd> 
   <ns1:H1RR>S</ns1:H1RR> 
   <ns1:H1ProfileDate>2015-06-12</ns1:H1ProfileDate> 
   <ns1:H1Ind>N</ns1:H1Ind> 
</ns1:H1>
</ns1: Payload>
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Based on what you have shown, my only recommendation is what I noted up above...use Aggregate, not trigger, AND add an entirely unique element to the parent above it, by adding a counter column upstream.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply