An empty file is being created by lookup stage

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
jeisma
Participant
Posts: 18
Joined: Mon Mar 20, 2017 12:19 pm

An empty file is being created by lookup stage

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

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

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jeisma
Participant
Posts: 18
Joined: Mon Mar 20, 2017 12:19 pm

Post 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!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply