Generated files with 0 bytes

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
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Generated files with 0 bytes

Post by gpbarsky »

[:)][:)][:)][:)][:)]

Hi my friends.

First of all, I want to specially thank to Kim and Ray who answered my previous questions about the invocations ids and the TCl for retrieving them. I am analyzing that, and when I have a conclusion I will post all the results.

I have a big problem with files, because after a process (a server job), many files with 0 bytes are being generated. It is not a logic problem. I want to avoid this generation. I checked the option to omit the last new line, I put the file format to NONE (instead of Unix or DOS), but anyway, the files are being generated with 0 bytes.

The question of the million is: how to avoid this generation ?

It is very uncomfortable to work in this way, because my user is seeing files, that he should not see (0 bytes). And the view of the browser, becomes to large for the user [:(]

Does anybody know what can I do ?

Thanks in advance.

[:)][:)][:)][:)][:)]

Guillermo P. Barsky
Buenos Aires - Argentina
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Guillermo

Create an after routine or run a process after the job and delete all zero byte files. I do not think DataStage can not generate it. I think you need to remove it. When you open a sequential file in BASIC then the status command can tell you how long the file is. You could also do it in a shell script.

find mydir -size 0 -exec rm {} ;

I think the syntax is close.

Kim.

Kim Duke
DwNav - ETL Navigator
www.Duke-Consulting.com
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If they are being created by Sequential File stage, you can check Omit Last NewLine on the Inputs tab (Format tab).

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Ray:

Yes. This is the case, and I already have the Omit Last NewLine on the Inputs tab check, checked. This is cause I don't understand why the file is being generated yet.

Do you know ? Is there any other option in DataStage to select when the files should being generated, when the files has 0 bytes?

Thanks [8D]


Guillermo P. Barsky
Buenos Aires - Argentina
inter5566
Premium Member
Premium Member
Posts: 57
Joined: Tue Jun 10, 2003 1:51 pm
Location: US - Midwest

Post by inter5566 »

Guillermo,

My off the wall guess is that the generated files are not trully empty or null. Check the files to verify that there is no white space on the first line,i.e. tab, space, nonprintable characters.
Perhaps your process is passing one blank field or record to the output.

Steve
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

Guillermo,

Based on what you have written the reason these sequential files are being created is because they are output stages. If you constrain an incoming recordset so that nothing travels down a specific link the file is still created. This is one of the first things DataStage does when a run begins or a job is validated - verification that the file can be created/opened and written to.

Test this yourself by creating a job that reads rows from an input and has a sequential output stage. Next define a constrain something like -

@INROWNUM < 0

You will see that no rows traveled down your output link, although the file has been created.

No way around this, although this post outlines a couple of methods for removing these files.

Regards,

Michael Hester
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

[:)][:)][:)][:)][:)]

Michael:

Thank you. You was very clear.

The only way that I found to avoid this is run a job for checking if there are at least one record matching the criteria, previous to run the definitely job. If so, then the job that I want is run.

Thank to all of you by your comments and suggestions. I'm learning a lot with you.

Have a nice week end.

[:)][:)][:)][:)][:)]

Guillermo P. Barsky
Buenos Aires - Argentina
Post Reply