Page 1 of 1

prevent file creation

Posted: Fri Sep 19, 2008 7:55 am
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?

Posted: Fri Sep 19, 2008 8:04 am
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.

Posted: Fri Sep 19, 2008 10:02 am
by myukassign
:shock:


oopssssssssssssss

I will go for a workaround

Posted: Fri Sep 19, 2008 11:00 am
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.