Create Sequential Files only if they somme row

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
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

Salut Sebastien,

I don't see your problem. I you have no (=zero) row on your link2 and your link2 goes to a sequential file then it is okay that the file is empty (has zero lines). All other results would be a problem.

Wolfgang
Guten tag Wolfgang !

I just have a transformer with one constraint. This constraint is a lookup on a OCI.
If notisnull the row go to a link1 on another OCI.
If isnull the row must go a link2 and create a sequential files.

With the monitor, i have no row on my link2 but after the job i have an empty sequential file !
I's my problem.

Bye

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You could create an after-stage or after-job call to ExecSH to test whether the file is empty and delete it.

Use "test -z pathname" to determine whether the file is empty.
sankar18
Participant
Posts: 34
Joined: Mon Dec 16, 2002 1:18 am

Post by sankar18 »

What do you with second sequential file.If there is no record in the sequential file, you want to delete it.Are you asking how to send the not null to first sequential file andthe null to second sequential file.can you make it clear.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I think this thread is basically closed and 'scognet' got their answer. There is no way to avoid the creation of the sequential file referenced by the stage, the simple act of opening the file creates it with zero length. If this empty file really isn't wanted, it needs to be explicitly deleted after the job ends after properly testing to verify that it is empty, as described above.

-craig
Post Reply