FTP file is empty

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
databind
Premium Member
Premium Member
Posts: 8
Joined: Wed Oct 17, 2007 11:44 pm

FTP file is empty

Post by databind »

Hi,

I have .txt file on FTP server to be uploaded to Oracle. I would like to get messages if this file is empty. How can I do this through DS?
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: FTP file is empty

Post by sachin1 »

Please let us know when you want to track for empty file before ftp or after ftp operation.
databind
Premium Member
Premium Member
Posts: 8
Joined: Wed Oct 17, 2007 11:44 pm

Post by databind »

it should be before FTP operation
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Post by sachin1 »

to get message for empty file before ftp operation, you can create custom routine to check for file size and log the message, abort operation or continue operation.
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Post by sachin1 »

[quote="sachin1"]to get message for empty file before ftp operation, you can create custom routine to check for file size and log the message, abort operation or continue operation, routine to be used in before job subroutine
databind
Premium Member
Premium Member
Posts: 8
Joined: Wed Oct 17, 2007 11:44 pm

Post by databind »

Does anyone have example of routine to get file size???
please help...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What O/S? Where - local to the DataStage server? Remote? Details of your requirements would be nice.
-craig

"You can never have too many knives" -- Logan Nine Fingers
databind
Premium Member
Premium Member
Posts: 8
Joined: Wed Oct 17, 2007 11:44 pm

Post by databind »

Craig,
My DataStage server's OS is W2K3.
Files to load will be on FTP server(Linux or Unix).
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ok, that's one part of the puzzle. Now just need to get a better idea what your requirements are, so why don't you lay that out for us?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,

You could use Before Job SubRoutine properties in Job Control window.
Select Before Job Routine ExecSh
Input value du -sk <filename>

This will give you file size.

Depending upon it you can take further action.


Ketfos
Post Reply