I am using the test -s filename command in the ExecuteCommand stage to check for a an empty file. A return code of 0 continues control to the next job else the sequence aborts. However this does not work. Always aborts with following message whether the file is empty or not.
"JobSeqLoadAdExtract..JobControl (@EmptyFileCheck): Executed: /usr/bin/test -s Users.csv
Reply=1
Output from command ====>
/usr/bin/test[7]: test: Specify a parameter with this command."
I changed to use wc instead. It passes through even for empty files.
wc -c Users.csv|cut -c1|grep [1-9]
Any workaround?
thanx
Empty File check in Server Job Sequence
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 19
- Joined: Fri Apr 02, 2004 10:13 am
There are several. You could use a shell script which does an exit 0 or exit 1 when it fails. You would need to do more error checking.
You could do an openseq in BASIC. The status command will give you the size of the sequential file. Do a search Ray and others have posted code on the status command.
You could do an openseq in BASIC. The status command will give you the size of the sequential file. Do a search Ray and others have posted code on the status command.
Mamu Kim
Is your filename to check - Users.csv - a job parameter? The Execute Command stage doesn't parse them correctly. Yes, the log entry looks just peachy but the actual command executed includes the untranslated job parameter, which may be what's tripping you up.
Me, I'd do this in a routine and use DSExecute. You have alot more control over how to handle the output of the command and what gets passed back to the Sequence job.
Me, I'd do this in a routine and use DSExecute. You have alot more control over how to handle the output of the command and what gets passed back to the Sequence job.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 19
- Joined: Fri Apr 02, 2004 10:13 am
Thanks all. The problem was with the way it parses the parameters. I am now doing it as a routine.chulett wrote:Is your filename to check - Users.csv - a job parameter? The Execute Command stage doesn't parse them correctly. Yes, the log entry looks just peachy but the actual command executed includes the untranslated job parameter, which may be what's tripping you up.
Me, I'd do this in a routine and use DSExecute. You have alot more control over how to handle the output of the command and what gets passed back to the Sequence job.