Hash File cleanup

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
chandoo7
Premium Member
Premium Member
Posts: 23
Joined: Tue Jun 21, 2005 5:49 pm

Hash File cleanup

Post 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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The answer will depend on if they were created 'pathed' or in an account...
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chandoo7
Premium Member
Premium Member
Posts: 23
Joined: Tue Jun 21, 2005 5:49 pm

Hash File Cleanup

Post 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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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,
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
rwierdsm
Premium Member
Premium Member
Posts: 209
Joined: Fri Jan 09, 2004 1:14 pm
Location: Toronto, Canada
Contact:

Post 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: )
Rob Wierdsma
Toronto, Canada
bartonbishop.com
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Atleast this time I did not put in a date. You guys keep killing me :twisted:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply