Batch Job for deleting a hash file
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 197
- Joined: Mon Feb 17, 2003 11:20 pm
- Location: India
Batch Job for deleting a hash file
Hi All,
I have a Batch Job to delete a hash file. It takes hash file name as an input parameter.
Below is the code. "HashFileName" is the input parameter.
If IsNull(HashFileName) OR TrimF(TrimB(HashFileName)) = ''
Then
Call DSLogFatal("Hash file does not exist.", DeleteHashFileUtility)
End Else
CMD = "DELETE.FILE ": HashFileName
Call DSExecute("UV", CMD, Sysoutput, ReturnCode)
End
The problem is, when I delete a HashFile using this Batch Job and then run a select statement from the hash file in Command Interface I get the following message:
' Unable to open "" file. '
Ideally the message should be:
' DataStage/SQL: Table <HashFileName> does not exist. '
However, when I try to query the file using UtilityHashLookup it gives the result instead of saying "Table Not Found".
I guess the Batch Job is not at all deleting the file. It just puts a lock on the file because of which we are unable to query the file from Command Interface.
Is there anything wrong with the code?
Regards,
Sumit
I have a Batch Job to delete a hash file. It takes hash file name as an input parameter.
Below is the code. "HashFileName" is the input parameter.
If IsNull(HashFileName) OR TrimF(TrimB(HashFileName)) = ''
Then
Call DSLogFatal("Hash file does not exist.", DeleteHashFileUtility)
End Else
CMD = "DELETE.FILE ": HashFileName
Call DSExecute("UV", CMD, Sysoutput, ReturnCode)
End
The problem is, when I delete a HashFile using this Batch Job and then run a select statement from the hash file in Command Interface I get the following message:
' Unable to open "" file. '
Ideally the message should be:
' DataStage/SQL: Table <HashFileName> does not exist. '
However, when I try to query the file using UtilityHashLookup it gives the result instead of saying "Table Not Found".
I guess the Batch Job is not at all deleting the file. It just puts a lock on the file because of which we are unable to query the file from Command Interface.
Is there anything wrong with the code?
Regards,
Sumit
-
- Participant
- Posts: 197
- Joined: Mon Feb 17, 2003 11:20 pm
- Location: India
Kim, the problem is that the batch job is actually not deleting the hash file. I feel so because If I delete hash file using this batch job and then try to view the deleted hash files' data using UtilityHashLookup it does not throw an error message. Ideally it should throw a message saying "Table Not Found".
All I want is, when I delete a hash file using this batch job then no one should be able to access the file using either UtilityHashLookup or Commany Interface. The file should physically get deleted from UV. But this is not happening.
Regards,
Sumit
All I want is, when I delete a hash file using this batch job then no one should be able to access the file using either UtilityHashLookup or Commany Interface. The file should physically get deleted from UV. But this is not happening.
Regards,
Sumit
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If the hashed file was created in a directory, rather than an account, then DELETE.FILE will not work; you'll need rm (UNIX) or del (Windows).
If the hashed file was created with a UV stage, then DELETE.FILE will not work; you'll need DROP TABLE.
If it was someone else who created the hashed file, there may be operating system permissions issues preventing you from deleting the hashed file. This is more likely to occur on UNIX (where umask is the culprit) than on Windows, but it's not impossible on the latter.
If the hashed file was created with a UV stage, then DELETE.FILE will not work; you'll need DROP TABLE.
If it was someone else who created the hashed file, there may be operating system permissions issues preventing you from deleting the hashed file. This is more likely to occur on UNIX (where umask is the culprit) than on Windows, but it's not impossible on the latter.
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.
-
- Participant
- Posts: 197
- Joined: Mon Feb 17, 2003 11:20 pm
- Location: India
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The error message
suggests that the parameter value is not being properly transmitted. Check that you have spelled it and used the same combination of upper and lower case letters in your code as in the parameter definition.Unable to open "" file.
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.
delete a sequential file
Hi,
I want to delete a sequential file using the datastage job.How to delete it.
Thanks
I want to delete a sequential file using the datastage job.How to delete it.
Thanks
You really should open a new topic, not just jump on the end of one that's sorta related. Then we'd know your DataStage version, operating system, etc. Plus, people looking for help on the same subject will have an easier time finding it, too!
That being said, you need to do this via your Operating System. Write a routine or make use of the before/after job ExecSH option to issue an rm or del of the sequential file.
That being said, you need to do this via your Operating System. Write a routine or make use of the before/after job ExecSH option to issue an rm or del of the sequential file.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
missing a line
You never assigned HashFileName to it's input parameter. DataStage does not automatically make parameters available.
Add this line to the top of your batch code:
Add this line to the top of your batch code:
Code: Select all
HashFileName = DSGetParamInfo(DSJ.ME,"HashFileName",DSJ.PARAMVALUE)