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
databind
Premium Member
Posts: 8 Joined: Wed Oct 17, 2007 11:44 pm
Post
by databind » Tue Oct 07, 2008 5:11 am
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
Post
by sachin1 » Tue Oct 07, 2008 5:17 am
Please let us know when you want to track for empty file before ftp or after ftp operation.
databind
Premium Member
Posts: 8 Joined: Wed Oct 17, 2007 11:44 pm
Post
by databind » Tue Oct 07, 2008 5:26 am
it should be before FTP operation
sachin1
Participant
Posts: 325 Joined: Wed May 30, 2007 7:42 am
Location: india
Post
by sachin1 » Tue Oct 07, 2008 5:36 am
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 » Tue Oct 07, 2008 5:37 am
[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
Posts: 8 Joined: Wed Oct 17, 2007 11:44 pm
Post
by databind » Tue Oct 07, 2008 5:40 am
Does anyone have example of routine to get file size???
please help...
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Tue Oct 07, 2008 7:02 am
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
Posts: 8 Joined: Wed Oct 17, 2007 11:44 pm
Post
by databind » Wed Oct 08, 2008 12:50 pm
Craig,
My DataStage server's OS is W2K3.
Files to load will be on FTP server(Linux or Unix).
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Wed Oct 08, 2008 12:53 pm
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 » Wed Oct 08, 2008 2:41 pm
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