How To Generate Dynamic Target File Based On Column Value

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
v_bhaskar
Participant
Posts: 33
Joined: Wed Apr 18, 2012 4:45 am

How To Generate Dynamic Target File Based On Column Value

Post 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
vijay
INDIA
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What 8.x release are you on? Pretty sure that functionality was added to the Sequential File stage at some point.
-craig

"You can never have too many knives" -- Logan Nine Fingers
v_bhaskar
Participant
Posts: 33
Joined: Wed Apr 18, 2012 4:45 am

Post by v_bhaskar »

Hi Criag,

currently i m using 8.5 Datastage 8.5 Version

Thanks for your help in advance
vijay
INDIA
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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).
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

Sequential stage in 9.1 does this. Folder Stage in Server also does this, in any release.
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply