Page 1 of 1

Hash File cleanup

Posted: Tue May 30, 2006 9:17 am
by chandoo7
Hi Guys

i have a situation where i am creating hash files like FileName_Date
i need to delete these hash files once entire batch has run.
we are using DataStage Server Edition 7.5.1 in windows environment.

anysuggetion to sort this issue?

thank you
chandra

Posted: Tue May 30, 2006 9:34 am
by DSguru2B
You can have a file that has all the hashed file names. You could have a small custom routine that invokes a TCL command DELETE.FILE and takes in a parameter (hashed file name). You can build a job, access that file and in the transformer call that routine. This will take care of all your Hashed files.
on the top of my head, the routine could be something like

Code: Select all

      if not(isnull(HashName))
      then
         Call DSExecute("TCL", "DELETE.FILE ":HashName, output, retcode)
         call DSLogInfo (output, "DELETEHash")
      end
      Ans = retcode

Posted: Tue May 30, 2006 9:39 am
by chulett
The answer will depend on if they were created 'pathed' or in an account...

Posted: Tue May 30, 2006 9:42 am
by DSguru2B
Yes. I totally forgot about that. My solution will work for files that are created in an account. For pathed a different approach is required.

Hash File Cleanup

Posted: Tue May 30, 2006 10:06 am
by chandoo7
DSguru2B wrote:Yes. I totally forgot about that. My solution will work for files that are created in an account. For pathed a different approach is required.
Jules Renard-

we are using account for hash file creation. your solution is working.
thank you for helping me.

Best regards
Chandra

Posted: Tue May 30, 2006 10:10 am
by DSguru2B
Your welcome.
BTW, my name is not Jules Renard and i certainly did not die in 1910 :?
Jules Renard was a french author whos quote i have as a footer.
Regards,

Posted: Wed Jun 07, 2006 10:02 am
by rwierdsm
DSguru2B wrote:Your welcome.
BTW, my name is not Jules Renard and i certainly did not die in 1910 :?
Jules Renard was a french author whos quote i have as a footer.
Regards,
Thanks for the clarification, Chuck.

(sorry, couldn't let that one go :wink: )

Posted: Wed Jun 07, 2006 10:30 am
by DSguru2B
Atleast this time I did not put in a date. You guys keep killing me :twisted: