Page 1 of 1

An empty file is being created by lookup stage

Posted: Fri Jun 02, 2017 4:30 pm
by jeisma
hi,

i have a lookup stage that if there is a failure, a log will be inserted in the error log file.

however, even if there is no lookup failure (reject), the log file is created although it's empty.

is this an expected behaviour? i don't want the file being created if there is no lookup failure.


TIA!

Posted: Fri Jun 02, 2017 4:55 pm
by chulett
Yes, expected. Any target file is created (if it doesn't already exist) when the job starts and the stage "opens"... regardless of it getting (or not getting) written to.

Posted: Sun Jun 04, 2017 1:53 am
by ray.wurlod
You can always delete it afterwards if it's empty, using an after-job subroutine or a downstream activity in the controlling sequence.

Posted: Mon Jun 05, 2017 10:46 am
by jeisma
so i used an execute command stage, to test the filesize, if it's zero, do something, else, some else.

thanks for the inputs!

Posted: Mon Jun 05, 2017 6:16 pm
by ray.wurlod
Yes, or a Routine activity.

DataStage BASIC has the STATUS statement that can report (among other things) the size of a file that has been opened with the OPENSEQ statement.