prevent file creation

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

prevent file creation

Post by myukassign »

My job has the following format.

Seq File ------ Transformer -----Sequential file.

I put a constraint in transformer to exclude some type of data from source.

Let suppose, if all the data in source is getting rejected by my constraint in the transformer, I don't want the target file to be created.

But what is happening is, target file is anyways getting created with 0 records.


Any solution to fix this issue?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

No. The file will always be created. If that 'issue' really bothers you, you can check after job and delete any zero-byte file I suppose.
-craig

"You can never have too many knives" -- Logan Nine Fingers
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Post by myukassign »

:shock:


oopssssssssssssss

I will go for a workaround
throbinson
Charter Member
Charter Member
Posts: 299
Joined: Wed Nov 13, 2002 5:38 pm
Location: USA

Post by throbinson »

There is a kind of a neato hack that would work but it would involve some heavy derivation lifting and most likely is NOT worth it.

Replace the Sequential File stage with a Folder stage with a column for the file name. This would create a "late binding" effect in that the file would not be created unless the constraint on the link was met. The overwhelming problem with this is that the file would be overwritten for each row going down the output link, leaving you with only the last output row. This could be overcome however but therein lies the hack. Enough said but I will mention that if you were creating some kind of semaphore file or some other file with a single row (or wanted to create a single row with a bunch of CHAR(10)s) this technique would work.
Post Reply