Page 1 of 1

Add Value from File

Posted: Fri Dec 11, 2015 2:11 am
by cyclogenisis
Looking for a way to add a column and populate the value of that column for every row. The value of that column for every row will be coming a csv file with a date in it.

Posted: Fri Dec 11, 2015 7:08 am
by ArndW
Could you expand on the problem you are facing? Adding a column to a job and processing that extra column in a DataStage job is quite easy, so I'll assume that you have some other issue.

Posted: Fri Dec 11, 2015 9:49 am
by cyclogenisis
I have some data coming down the pipe like this:

Image

Need to add another column in the next step to this data that is coming downstream and the value for this column will be the same for every row. It is a date found in a csv file.

Posted: Fri Dec 11, 2015 11:00 am
by chulett
Create a job parameter to hold it and populate it using the file, then add the column in a transformer and reference the job parameter as the derivation.

Posted: Mon Dec 14, 2015 3:21 pm
by cyclogenisis
Sorry, how would you actually save the value from the sequential file to the job parameter?

Posted: Mon Dec 14, 2015 4:26 pm
by chulett
That would typically be handled via a Sequence job and there are a handful of current topics on that subject over in the General forum. This one as one example, there should be plenty more. Basically you need something to 'read' the file and then pass the result to the Job Parameter in the Job Activity stage.

Posted: Mon Dec 14, 2015 6:00 pm
by chulett
Is there only one record in the file? Then 'reading' it might be as simple as using an Execute Command stage to cat the file to standard out and then you would need to capture the $CommandOutput from the stage to send to the parameter, something the Sequence job would automate for you.

Posted: Tue Dec 15, 2015 3:51 am
by naveenkumar.ssn
Hi

Could not view your image.

Can you put down as the text if possible

Regards
Naveen

Posted: Tue Dec 15, 2015 8:33 am
by chulett
Not really sure why they felt the need to heavily redact the screenshot of the job but also didn't really see a need for it to answer the question. IMHO.

Guessing they have some sort of proprietary naming system and they're simply protecting their IP. :wink:

Posted: Thu Dec 17, 2015 4:15 pm
by cyclogenisis
Thanks chullett. Actually some of my links have table naming convention in them so I thought it would be best to take those out. ;).