Delete file

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
rsunny
Participant
Posts: 223
Joined: Sat Jul 03, 2010 10:22 pm

Delete file

Post by rsunny »

Hi ,

Is there any command that i can use in after job subroutine to delete a file if the rows are zero.

I mean for unix there is something like

`cat filename | wc -l ` -eq 0 to delete a file using after job subroutine with DSexecute f the rows are zero

Is there anything similar to this kind in windows?

Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you have parallel (Enterprise Edition) installed? If so you can use UNIX commands on Windows.

Otherwise you can create an after-job subroutine in DataStage BASIC that opens file using OpenSeq, uses the Status statement to determine the file size, closes the file then deletes the same if the size was zero.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rsunny
Participant
Posts: 223
Joined: Sat Jul 03, 2010 10:22 pm

Post by rsunny »

ray.wurlod wrote:Do you have parallel (Enterprise Edition) installed? If so you can use UNIX commands on Windows.

Otherwise you can create an after-job subroutine in DataStage BASIC that opens file using OpenSeq, ...
Hi ray,

we have only server edition and we dont have paallel edition installed.

Thanks in advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then go with my other suggestion.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply