Page 2 of 2

Posted: Fri Jul 19, 2013 1:20 am
by PAULOM
I do not understand very well,

So that the Stage Folder works, I have to put all my lines in a single column and a single row.

Do I have to a Stage Variable to transform it (how can it be done?), add Aggregator? To put all this in a Routine?

Thank you for helping me.

Posted: Fri Jul 19, 2013 6:30 am
by chulett
That's the problem - "all my lines". Ray responded as he did because you said you needed your output to be:

1;2;3;4;5;6;8

You showed a subset of your input fields in the output. Everything before this point assumed a simple concatenation of one record to the next without any 'intelligence' in the process, meaning you should send to the Folder stage:

1;2;3;3;4;5;6;7;8

Based on your sample input. Are you certain that is really what you need? Or is that a typo? Nothing in the conversation up to this point indicated a need for any such thing and it's certainly not a requirement for the Folder stage, hence the question.

Now, to further add to your confusion, you actually need a single row that includes all of the records that the Folder needs to write out. Meaning you need to add record delimiters (not just the data) to the work you do in the stage variable. On Windows that would be a <CR><LF> pair while on UNIX you just need a <LF> between the records:

1;2;3<CR><LF>3;4;5<CR><LF>6;7;8

Use a stage variable with the proper initial value and no derivation so it is a constant during the run. Set the initial value to CHAR(13):CHAR(10) for Windows.

Posted: Fri Jul 19, 2013 7:31 am
by PAULOM
Chulett it's possible to send you my dsx?

Posted: Fri Jul 19, 2013 7:43 am
by chulett
Wouldn't help, I have no DataStage access so couldn't do much with it. Working on my fourth year using another ETL tool... I just do this for the fun. :wink:

Posted: Fri Jul 19, 2013 7:49 am
by PAULOM
Ok it's a pity!

Posted: Fri Jul 19, 2013 4:04 pm
by ray.wurlod
You can post images on an image server and refer to them here. But do try to answer the questions we've asked as completely as possible.

Posted: Tue Jul 23, 2013 7:02 am
by arunkumarmm
I guess his output to be a typo, as he even missed '7'.

If my guess is right, you can have your stage variable as below:

StagVar1: StagVar1 : ';' : ColumnA : ';' : ColumnB : ';' : ColumnC
StagVar2: Trim(StagVar1,';',"L")

set you stage variable's initial value as Empty ( '' )

Assuming that your column values will not be null or empty

And if you have problem working with Aggregators, you can just write your output to a Hashed file with a dummy key column with a static value, say '1' and then pass it on to the folder from hashed file.