Testing for empty file condition in Server Job

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

dstukai
Participant
Posts: 7
Joined: Wed Nov 20, 2013 12:18 pm

Post by dstukai »

chulett wrote:As noted, lots of DOS help out there. Here's one I found with a quick search:

http://www.dostips.com/?t=Snippets.ZeroBytesCheck

Excellent..Thanks a lot Craig.
dstukai
Participant
Posts: 7
Joined: Wed Nov 20, 2013 12:18 pm

Post by dstukai »

Craig/Ray,
Have a problem with executing the script after the file extraction done to check for empty file. We mainly get files in .del and .csv format. Now, I build the script with ErrorLevel1, so when the record is 0, script will fail. The issue is, even though the .csv file is empty it is 2 bytes and when the data is empty it has header which is almost 170 bytes. How does the scrip know when the file has 2 bytes or more. I mean, if we use 0 bytes code, then the script will run though file is empty or with just the header included. Any thoughts?
Post Reply