Sequential File clear

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
MAT
Participant
Posts: 65
Joined: Wed Mar 05, 2003 8:44 am
Location: Montréal, Canada

Sequential File clear

Post by MAT »

Hi,

I am using a sequential file on UNIX to store temporary data. The file is then loaded by a job into a database table. The problem is that I want to clear the data in the file after a successful load. the best way I see is to use a after subroutine but I do not see a way of clearing a sequential file with DataStage functions. Does anyone know about this? Should I use a DS function or use a UNIX command inside a DSExecute?

Regards

MAT
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you want to do it within DataStage BASIC, you can do an OpenSEQ then immediately do WEOFSeq to truncate the file. This is documented in the online help for WEOFSeq. Otherwise, yes - DSExecute with a Unix script could be utilized as well.

Make sure you check off the "only on successful completion" option.

-craig
MAT
Participant
Posts: 65
Joined: Wed Mar 05, 2003 8:44 am
Location: Montréal, Canada

Post by MAT »

Works perfectly!!

Thanks

MAT
Post Reply