Hashed file cleaning/deletinf

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
berettae
Participant
Posts: 5
Joined: Tue Jan 21, 2003 11:57 am
Location: Italy

Hashed file cleaning/deletinf

Post by berettae »

Hi all, i'm working in DW project and dediced to store the hashed file in a directory (different from the project one) using the command directory in the hashed file stage.

but when i tried to use the UV routine DELETE FILE or CLEAR FILE the routine look for the file in the project directotry not finding them.

How can i specify the hashed file directory in the clear or delete routine?

TX
Amos.Rosmarin
Premium Member
Premium Member
Posts: 385
Joined: Tue Oct 07, 2003 4:55 am

Post by Amos.Rosmarin »

This issue was discussed many times in this forum, you can do CLEAR.FILE only for registered files (like ones created under DS account) or delete the file directory and the D_ file.

a routine example :

Code: Select all

 

      If System(91) Then                 ; *  Windows system
         Delim = '\'
         delCmd = ' DEL /S ' : directoryPath : Delim : hashFileName : ' && DEL /S ' : directoryPath : Delim : 'D_' : hashFileName
         
 os = 'NT'
      End Else                           ; * Unix
         Delim = '/'
         delCmd = ' \rm -rf  ' : directoryPath : Delim : hashFileName : ' && \rm -f  ' : directoryPath : Delim : 'D_' : hashFileName
         os = 'UNIX'
      End

      

Call DSExecute (os, delCmd , Output, SystemReturnCode)

      If SystemReturnCode <> 0 Then
         Call DSLogWarn('The del hash file command (':delCmd:') returned status ':SystemReturnCode:':':@FM:Output, RoutineName )
      End Else
         Call DSLogInfo('Hash file ' : hashFileName : ' was deleted...',RoutineName )
      End

      Ans = SystemReturnCode

      Return(Ans)
rajendran77
Participant
Posts: 16
Joined: Mon May 14, 2007 1:46 pm

Post by rajendran77 »

Thanks for your detail code. Much appriciated. It helps me to solve my issue.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Once you have solved it, please mark this thread as resolved.

There is a third possibility; if the hashed file was created using a UV stage, then it must be dropped with a DROP TABLE command executed at TCL.
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