Page 1 of 1

Preventing an ftp if file is zero length

Posted: Mon Sep 11, 2006 12:28 pm
by kld05
Hi all,

Is there a simple way to pevent an ftp if the file doesn't contain any records? My job is currently creating a zero length file. I know I could write an after script to do this but just wanted to confirm that was the only way.

Posted: Mon Sep 11, 2006 12:36 pm
by meena
Are ftp'inf the file in a job or in a sequencer.
Do the file has column header.

Posted: Mon Sep 11, 2006 12:39 pm
by kld05
This is in a job without header information.

Re: Preventing an ftp if file is zero length

Posted: Mon Sep 11, 2006 12:42 pm
by Krazykoolrohit
kld05 wrote:Hi all,

Is there a simple way to pevent an ftp if the file doesn't contain any records? My job is currently creating a zero length file. I know I could write an after script to do this but just wanted to confirm that was the only way.
Check it in unix before you run the job. use If condition like

If -s filename then run job else abort

Or use sequencer and use activity stage to check if -s filename returns 1 or 0 and use conditional links to control the flow.

Re: Preventing an ftp if file is zero length

Posted: Mon Sep 11, 2006 12:49 pm
by thumsup9
Krazykoolrohit wrote:
kld05 wrote:Hi all,

Is there a simple way to pevent an ftp if the file doesn't contain any records? My job is currently creating a zero length file. I know I could write an after script to do this but just wanted to confirm that was the only way.
Check it in unix before you run the job. use If condition like

If -s filename then run job else abort

Or use sequencer and use activity stage to check if -s filename returns 1 or 0 and use conditional links to control the flow.
I think he meant Test -s Filename. You can use this in COmmand Actvity Stage or a routine.

Re: Preventing an ftp if file is zero length

Posted: Mon Sep 11, 2006 12:49 pm
by prabu
kld05 wrote:Hi all,

Is there a simple way to pevent an ftp if the file doesn't contain any records? My job is currently creating a zero length file. I know I could write an after script to do this but just wanted to confirm that was the only way.
1)use a contol job and check for the readiness of the file before you call the ftp job

2)Don't create an empty file if there is nothing to write[Meaning change your ftp script which actually does this]

3) use a .ready file as a ftp checker file [Wait for file activity in Sequencer].

some thoughts!

regards,
Prabu