Page 1 of 1

Hashed File Deletion in basic subroutine

Posted: Tue Dec 28, 2010 4:57 am
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

Posted: Tue Dec 28, 2010 6:39 am
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.