Delete Hash File via Routine

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
baglasumit21
Participant
Posts: 132
Joined: Wed Mar 01, 2006 11:12 pm
Location: Pune

Delete Hash File via Routine

Post 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
SMB
sachin1
Participant
Posts: 325
Joined: Wed May 30, 2007 7:42 am
Location: india

Re: Delete Hash File via Routine

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
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