empty file

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
harikumar
Participant
Posts: 33
Joined: Wed Apr 21, 2010 9:19 pm
Location: banglore

empty file

Post by harikumar »

hi
i my source table having 5 columns but target i want only empty file(with out columns) by using transformer
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

You can still map the five fields to the Sequential File stage from the Transformer. In the transformer stage make sure you default all the column derivations to empty strings(''). Make sure you set the First line is Column Names property to True and at the end of the job you will have an empty file. Restricting the row counts out of the transformer stage using system variables is up to you.

P.S. That's a unique requirement.
Kris

Where's the "Any" key?-Homer Simpson
chvenkat.v
Participant
Posts: 94
Joined: Fri Dec 14, 2007 3:22 am

Post by chvenkat.v »

Don't post interview Questions here.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Don't do anything. Simple.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'll have to do something to ensure you get an empty file from a non-empty source. For example, put something in the where clause that ensures you select zero records, where 1 = 2 for example. Or use a contraint in the transformer that ensures no records get past, @FALSE comes to mind.
Last edited by chulett on Sun Aug 15, 2010 7:41 am, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

chulett wrote:You'll have to do something to ensure you get an empty file.
Why ?

You can create an empty file whilst creating your project. Just don't do anything with that file afterwards.

No delete.....so no create.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why? Because I made the silly assumption that (since we're here) the question was not simply how to create an empty file but how to create an empty file using a DataStage job. It's unclear just how "empty" they want it to be, so I was also assuming it should be empty of data but still have the column names in there, otherwise what's the point? Without that all you need is a zero byte file and you can use touch or an equivalent to do that. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
grimm336
Participant
Posts: 12
Joined: Thu Jun 25, 2009 10:19 am

Post by grimm336 »

Hey i think you are not clear with the requirment. If you want to do some kind of funny tricks then dont post this kind of queries......
grimm
Post Reply