Hashed File Deletion in basic subroutine

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
prem84
Premium Member
Premium Member
Posts: 25
Joined: Sat Jul 03, 2010 11:55 pm
Location: chennai

Hashed File Deletion in basic subroutine

Post by prem84 »

Hi,
I want to delete a hashed file based on certain conditions from a routine.
I used the command
Call DSExecute('UV', "DELETE FROM ":pHashFileName:" WHERE JobName = '":pJobName:"';", cmdOutput, cmdRetCode)
where pHashFileName and pJobName are parameters.This one works when hashed files are created as account based.
But how to delete the file when they are created in a different path.
I used SETFILE to specify path in dsexecute but it didn't work also i tried to the give the full path as parameter but still it failed.Kindly help
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So, it's not that you want to "delete a hashed file" but rather you want to delete records from a hashed file, yes? As you've found, you can only do that for hashed files that have a VOC record pointer established for them and you get one of those in two ways:

1. An "account based" hashed file has one created for it automatically.
2. A "path based" hashed file would need one created manually.

For the latter, you would indeed need to use SETFILE to create the VOC pointer... one time. You could do so every time you called the routine as long as you added the OVERWRITING option to the function so it doesn't fail when it finds the pointer already exists the second (etc) time it runs.

An exact search here for SETFILE should turn up many examples of how it is used and the syntax involved. If you've done that and still haven't been able to make it work, post your syntax so we can help you correct it. Simply saying that what you tried "didn't work" doesn't give anyone enough information about what you did in order to provide any cogent help.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply