How i can Do this

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
bollinenik
Participant
Posts: 111
Joined: Thu Jun 01, 2006 5:12 am
Location: Detroit

How i can Do this

Post by bollinenik »

Hi,

I have input like
FV A 0001 6999
FV A 8001 9099
FV A 9101 9299
FV A 9301 9999
GU A 15*
HL A 0001 6999
HL A 8001 9099
HL A 9101 9299

Required OutPut is
Fv A0001-A6999,A8001-A9099,A9101-A9299,A9301-A9999
GU A15*-A
HL A0001-A6999,A8001-A9099,A9101-A9299

In Oracle pluging Stage I did append Then I got required output but that is target level appending if it's reched max length then it's rejecting so, The same appending i need to do same at source leval This means in DataStage pls any one can help me
Thanks in advance
kOTI,
1586-738-7785
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Search the forum for "vertical pivot". There are several strategies available, depending on particular requirements (for example whether there is a known or arbitrary maximum number of rows to be pivoted). Therefore, without knowing the circumstances more fully, no-one is going to suggest "an" answer, as it may not be apposite.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vinodn
Charter Member
Charter Member
Posts: 93
Joined: Tue Dec 13, 2005 11:00 am

Post by vinodn »

Thx Ray
Following are my circumstences
parallel job is reading data from SAP and and loading into the Oracle So I need to do all that in DS, I am using stag variables and all but that loop is not repeatimg The scenario is like this
There are four fields from source like A,B,C,D Logic is
A BC-BD,BC-BD like that it should populate concatinate values the loop should continue up to value should change in A

Thx in Advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I understand completely what you are trying to do, except for the specific circumstances (such as whether there is a known maximum number of columns that will be generated). The technique is called "vertical pivot". How you accomplish it depends on circumstances such as that mentioned above. There is no "loop" needed - what is needed, generally, is that your input stream is sorted on the pivot key. You accumulate columns until a change in the pivot key occurs.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply