XML Requirement

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
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

XML Requirement

Post by vamsi.4a6 »

New to XML and input is really appreciated

Code: Select all

<STORELIST>
<ST> 
 <STOREID> 1 </ STOREID> 
 <STORENAME> ABC</ STORENAME> 
   <product> 
             <KEY_1>1</KEY_1>
             <KEY_2>2</KEY_2>
             <product1>Fan</ product1> 
             <product2>Light</ product2> 
              
   </ product>
<ST/>
<ST> 
 <STOREID> 2 </ STOREID> 
 <STORENAME> CDE</ STORENAME> 
   <product> 
             <KEY_1>3</KEY_1>
             <KEY_2>4</KEY_2>
             <product1>BALL</ product1> 
             <product2>BAT</ product2> 
              
   </ product>
<ST/>
</ STORELIST>
Like this we have Multiple ST tags which contains information about various stores and multiple products.We have composite key(KEY_1,KEY_2) in product tag.

STORELIST

o/P REQUIRED is:
STOREID STORENAME
1 ABC
2 CDE


I am able to get first o/p but not able to get below o/p Since i have composite key in PRODUCT tag and i can not select Multiple Keys in columns tab.Not sure how to proceed

PRODUCTLIST

STOREID STORENAME product1 product2 KEY_1 KEY_2
1 ABC Fan Light 1 2
2 CDE BALL BAT 3 4

Doubts:
1)whether i need to select the Repetition element required or not on Transformation setting of output tab?
2)whether i need to select the Repetition element required or not on Transformation setting of stage tab?
3)Key and Transformation settings of output tab to populate the
PRODUCTLIST Table ?

Job design:

externalsource->XML INPUT STAGE(TWO OUTPUTLINKS)-->ONE LINK TO STORELIST AND ANOTHER LIST TO PRODUCTLIST
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Looks like one single list of stores ---- so one output link......not two....(The products are named uniquely as product1 and product2 in their tagnames ---- get them out of xml as separate columns and then pivot them downstream if you need two rows for every store.
Ernie Ostic

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