Create the sequential file based on condition

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
bharathappriyan
Participant
Posts: 47
Joined: Fri Sep 23, 2005 6:01 pm

Create the sequential file based on condition

Post by bharathappriyan »

Hi,

The job has a source table and target sequential file. It is one to one mapping. If there is any data in the table, the sequential file should be created. Otherwise, the job should not create an Empty file.

Is there a way to handle in the job?

Thanks.
swades
Premium Member
Premium Member
Posts: 323
Joined: Mon Dec 04, 2006 11:52 pm

Re: Create the sequential file based on condition

Post by swades »

bharathappriyan wrote: the job should not create an Empty file.
Not possible in single job. Put some check (record count or file size) after job finish successfully and remove file if it is empty.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Technically, this is not possible at all. You run the job, the file is created, period. So you have two choices - either delete the file post job if empty or don't run the job without data to process.
-craig

"You can never have too many knives" -- Logan Nine Fingers
keshav0307
Premium Member
Premium Member
Posts: 783
Joined: Mon Jan 16, 2006 10:17 pm
Location: Sydney, Australia

Post by keshav0307 »

you can use an after job subroutine, to delete the file if it is empty
Post Reply