Clearing HashFiles
Moderators: chulett, rschirm, roy
Clearing HashFiles
Hi,
We got few jobs from peoplesoft.all hashfiles had been created in project directory.So we are creating new directory to create hash files in it.
in one job (this is reusable job), there is one after job subroutine to clear the hashfile.
for this the parameter is file name .But now i want to send the full path to this routine.I tried but it didn't work.Can you please help me in passing the parameter to after job subroutine
Thanks
Sri
We got few jobs from peoplesoft.all hashfiles had been created in project directory.So we are creating new directory to create hash files in it.
in one job (this is reusable job), there is one after job subroutine to clear the hashfile.
for this the parameter is file name .But now i want to send the full path to this routine.I tried but it didn't work.Can you please help me in passing the parameter to after job subroutine
Thanks
Sri
Might be helpful to post your routine code.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Sorry for the confusion and inconvenience
Here is the routine
Beginning of the routine
Open InputArg TO HashFile Else
End
CLEARFILE HashFile
Close HashFile
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
this is after job subroutine.It expects file name.
So i send the full path name as parameter .it didn't work
I changed the routine like this, but no luck
Open InputArg TO HashFile Else
End
HashTable = "/apps/bea/pt848/psoft1/Ascential/DataStage/Projects/Test/HashFiles/":HashFile
CLEARFILE HashTable
Close HashFile
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
Thanks
Here is the routine
Beginning of the routine
Open InputArg TO HashFile Else
End
CLEARFILE HashFile
Close HashFile
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
this is after job subroutine.It expects file name.
So i send the full path name as parameter .it didn't work
I changed the routine like this, but no luck
Open InputArg TO HashFile Else
End
HashTable = "/apps/bea/pt848/psoft1/Ascential/DataStage/Projects/Test/HashFiles/":HashFile
CLEARFILE HashTable
Close HashFile
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
Thanks
DsGuru thanks for your reply
I changed like this , but it didn't work
OpenPATH InputArg TO HashFile Else
End
HashTable = "/apps/bea/pt848/psoft1/Ascential/DataStage/Projects/test/HashFiles/":HashFile
CLEARFILE HashTable
Close HashFile
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
Thanks
I changed like this , but it didn't work
OpenPATH InputArg TO HashFile Else
End
HashTable = "/apps/bea/pt848/psoft1/Ascential/DataStage/Projects/test/HashFiles/":HashFile
CLEARFILE HashTable
Close HashFile
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
Thanks
DsGuru thanks for your reply
I changed like this , but it didn't work
OpenPATH InputArg TO HashFile Else
End
HashTable = "/apps/bea/pt848/psoft1/Ascential/DataStage/Projects/test/HashFiles/":HashFile
CLEARFILE HashTable
Close HashFile
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
Thanks
I changed like this , but it didn't work
OpenPATH InputArg TO HashFile Else
End
HashTable = "/apps/bea/pt848/psoft1/Ascential/DataStage/Projects/test/HashFiles/":HashFile
CLEARFILE HashTable
Close HashFile
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
Thanks
Try the following
Code: Select all
PathedHFile="/apps/bea/pt848/psoft1/Ascential/DataStage/Projects/test/HashFiles/":InputArg
OpenPATH PathedHFile TO HashFile Else
End
CLEARFILE PathedHFile
Close HashFile
ErrorCode = 0 ;* set this to non-zero to stop the stage/job
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Bad code!
You go on to attempt ClearFile even if the file is not opened!
You go on to attempt ClearFile even if the file is not opened!
Code: Select all
* Arg1 contains pathname of hashed file.
OpenPath Arg1 To hFile
On Error
ErrorCode = Status()
Call DSLogWarn('Error opening "' : Arg1 : '".', "Before Job")
End
Then
ClearFile Arg1
ErrorCode = 0
Close hFile
Call DSLogInfo(Quote(Arg1) : ' has been cleared.', "Before Job")
End
Else
ErrorCode = 1
Call DSLogWarn('Unable to open "' : Arg1 : '".', "Before Job")
EndIBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Thanks Ray and DsGuru
I appreciate your help
I tried to follow Ray's Code
This is after job subroutine
my job is getting aborted ,but not giving any error message.
I am not able to test this routine in manager,the run button was disabled.Can you please tell me how to test. and also can you please tell me where did I go wrong in the routine
I passed only the file name as input value (#DeltaHashFile#)to the routine .path name is already in the routine
Arg1="/apps/bea/pt848/psoft1/Ascential/DataStage/Projects/test/HashFiles/":InputArg
OpenPath Arg1 To hFile
On Error
ErrorCode = Status()
Call DSLogWarn('Error opening "' : Arg1 : '".', "After Job")
End
Then
ClearFile Arg1
ErrorCode = 0
Close hFile
Call DSLogInfo(Quote(Arg1) : ' has been cleared.', "After Job")
End
Else
ErrorCode = 1
Call DSLogWarn('Unable to open "' : Arg1 : '".', "After Job")
End
Thanks you very much.
I appreciate your help
I tried to follow Ray's Code
This is after job subroutine
my job is getting aborted ,but not giving any error message.
I am not able to test this routine in manager,the run button was disabled.Can you please tell me how to test. and also can you please tell me where did I go wrong in the routine
I passed only the file name as input value (#DeltaHashFile#)to the routine .path name is already in the routine
Arg1="/apps/bea/pt848/psoft1/Ascential/DataStage/Projects/test/HashFiles/":InputArg
OpenPath Arg1 To hFile
On Error
ErrorCode = Status()
Call DSLogWarn('Error opening "' : Arg1 : '".', "After Job")
End
Then
ClearFile Arg1
ErrorCode = 0
Close hFile
Call DSLogInfo(Quote(Arg1) : ' has been cleared.', "After Job")
End
Else
ErrorCode = 1
Call DSLogWarn('Unable to open "' : Arg1 : '".', "After Job")
End
Thanks you very much.
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Does this hashed file exist?
If not, you will need to create it using an mkdbfile command or by validating or running a DataStage job in which it appears.
The Hashed File Calculator will generate an appropriate mkdbfile command.
If not, you will need to create it using an mkdbfile command or by validating or running a DataStage job in which it appears.
The Hashed File Calculator will generate an appropriate mkdbfile command.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.

