Page 1 of 1

Delete Hash File via Routine

Posted: Thu Sep 20, 2007 10:23 pm
by baglasumit21
I have searched the forum for deleting Hash Files. I got the command as

delete.file HashFileName.

But I need to develop a Before/After Job routine for the same. Can any one help me in this regard, as I am getting a message as Variable Delete undefined

Re: Delete Hash File via Routine

Posted: Thu Sep 20, 2007 11:47 pm
by sachin1
hello for writing custom routine you need to check for paticular directory and hash file to delete, i mean to say their should be two input parameter.


next is basic code help text.

Use the EXECUTE statement to execute DataStage commands from within the
BASIC program and then return execution to the statement following the
EXECUTE statement.

below are few points that will help you

1.$INCLUDE UNIVERSE.INCLUDE OSDEF.H (need to include in your script).



2. SEP='\'
DEL=SYSTEM(32):SEP:"bin":SEP:"rm "
DELR = SYSTEM(32):SEP:"bin":SEP:"rm -r "
SHELL="DOS /C "

3.cmd = DELR:" ":filepath:SEP:"D_":filename
cmd = SHELL:'"':cmd:'"'


4.execute cmd capturing result1 returning error1


check for basic code help for Execute command.

Posted: Fri Sep 21, 2007 4:49 am
by ray.wurlod
There are three different ways to delete a hashed file (note, not hash file): which one you should choose depends upon how the hashed file was created.

Once you've sorted that out, you would invoke the appropriate command through a call to the DSExecute subroutine.