Page 1 of 1

Looping in a stage

Posted: Wed Aug 01, 2007 12:55 pm
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

Re: Looping in a stage

Posted: Wed Aug 01, 2007 2:06 pm
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!