Page 1 of 1

How To Generate Dynamic Target File Based On Column Value

Posted: Wed Sep 18, 2013 5:25 am
by v_bhaskar
Hi Team,

Can any help on below Scenario

How To Generate Dynamic Target File In datastage Based On Column Value

Code: Select all

Dept name, Dept ID, Location 
DWH           ,1       ,Mumbai 
Java          ,2       ,Bangalore 
Dot net       ,3       ,Delhi


i want to generate the file name as Mumbai.dat if the employee location is Mumbai.

Thanks

Posted: Wed Sep 18, 2013 7:27 am
by chulett
What 8.x release are you on? Pretty sure that functionality was added to the Sequential File stage at some point.

Posted: Thu Sep 19, 2013 4:56 am
by v_bhaskar
Hi Criag,

currently i m using 8.5 Datastage 8.5 Version

Thanks for your help in advance

Posted: Thu Sep 19, 2013 7:09 am
by chulett
Sorry, can't seem to find the details at the moment but did find this in my searches:
ray.wurlod wrote:Sequential File stage has the ability to generate the file name into an output column.
Hopefully someone can provide details on the 'how' of it.

Posted: Thu Sep 19, 2013 9:28 am
by ArndW
Craig, that applies to reading from multiple files; in this case the OP wishes to write to a dynamic file name and I don't know if that works (I don't think it can work).

Posted: Thu Sep 19, 2013 10:02 am
by eostic
Sequential stage in 9.1 does this. Folder Stage in Server also does this, in any release.

Posted: Thu Sep 19, 2013 10:03 am
by chulett
Yah... you're right, that's just adding the column name to the input stream. I'd be curious what Andy or Ray have to add because I could swear it was added 'recently' to the product and one of them mentioned that fact. Or perhaps Vincent^H^H^H^H^H^HErnie. Could be wrong, however. :?

Old School would be to write the file out like normal and then take advantage of your O/S to split the file up after the fact.

Posted: Thu Sep 19, 2013 10:07 am
by chulett
eostic wrote:Sequential stage in 9.1 does this. Folder Stage in Server also does this, in any release.
Thanks... 9.1, eh? Was going to mention the Folder stage but it is somewhat of a PITA to use as a target and tends to confuse the crap out of people attempting to use it. :wink: