Page 1 of 1

Sequential File clear

Posted: Fri Mar 07, 2003 9:43 am
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

Posted: Fri Mar 07, 2003 10:43 am
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

Posted: Fri Mar 07, 2003 12:20 pm
by MAT
Works perfectly!!

Thanks

MAT