Looping in a stage

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nag0143
Premium Member
Premium Member
Posts: 159
Joined: Fri Nov 14, 2003 1:05 am

Looping in a stage

Post by nag0143 »

Hi all,

I have an input file in which some columns occur 0 to 50 times depending on the value of another column (For example, if DOC_COUNT=3, then DOC_CD,DOC_FLG,DOC_IND,etc. will occur 3 times) and the file contains fields like CL, BR, RR, DOC_COUNT, CUST_TP, DOC_CD, DOC_FLG, DOC_IND,...

Now, I have to create a row for each occurence (I have to keep all columns). How can I do that? Is there anyway to do it in a transformer using stage vaiables? I'm working on it all the day.....

Thanks
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Re: Looping in a stage

Post by jdmiceli »

nag0143 wrote:Hi all,

I have an input file in which some columns occur 0 to 50 times depending on the value of another column (For example, if DOC_COUNT=3, then DOC_CD,DOC_FLG,DOC_IND,etc. will occur 3 times) and the file contains fields like CL, BR, RR, DOC_COUNT, CUST_TP, DOC_CD, DOC_FLG, DOC_IND,...

Now, I have to create a row for each occurence (I have to keep all columns). How can I do that? Is there anyway to do it in a transformer using stage vaiables? I'm working on it all the day.....
You might try using the Pivot Stage under the Processing section of the Palette. Hit the documentation and see if that will work for you. We did something similar, but I don't have access to the project anymore to be able to post more information as an example for you.

Bestest!
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
Post Reply