Page 1 of 1

FTP file is empty

Posted: Tue Oct 07, 2008 5:11 am
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?

Re: FTP file is empty

Posted: Tue Oct 07, 2008 5:17 am
by sachin1
Please let us know when you want to track for empty file before ftp or after ftp operation.

Posted: Tue Oct 07, 2008 5:26 am
by databind
it should be before FTP operation

Posted: Tue Oct 07, 2008 5:36 am
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.

Posted: Tue Oct 07, 2008 5:37 am
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

Posted: Tue Oct 07, 2008 5:40 am
by databind
Does anyone have example of routine to get file size???
please help...

Posted: Tue Oct 07, 2008 7:02 am
by chulett
What O/S? Where - local to the DataStage server? Remote? Details of your requirements would be nice.

Posted: Wed Oct 08, 2008 12:50 pm
by databind
Craig,
My DataStage server's OS is W2K3.
Files to load will be on FTP server(Linux or Unix).

Posted: Wed Oct 08, 2008 12:53 pm
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?

Posted: Wed Oct 08, 2008 2:41 pm
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