How to Clear a Hashed File Outside of Datastage Job?
Moderators: chulett, rschirm, roy
How to Clear a Hashed File Outside of Datastage Job?
Hi there,
Before run a job, how can a hashed file be cleared which is created in a previous run? If it is not cleared, the looking up from the hashed file will be wrong.
Thanks,
Before run a job, how can a hashed file be cleared which is created in a previous run? If it is not cleared, the looking up from the hashed file will be wrong.
Thanks,
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
CLEAR.FILE will work via ExecTCL only if the hashed file was created in an account.
If the hashed file was created in a directory you need the operating system variant (clear.file) with the pathname of the hashed file.executed via ExecSH (for UNIX) or ExecDOS (for Windows).
If the hashed file was created in a directory you need the operating system variant (clear.file) with the pathname of the hashed file.
Code: Select all
$DSHOME/bin/clear.file pathname
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.
I tryed it at UNIX prompt it did not work:ray.wurlod wrote:CLEAR.FILE will work via ExecTCL only if the hashed file was created in an account.
If the hashed file was created in a directory you need the operating system variant (clear.file) with the pathname of the hashed file.executed via ExecSH (for UNIX) or ExecDOS (for Windows).Code: Select all
$DSHOME/bin/clear.file pathname
$ clear.file /mount/test/sa/hash/CST010_hash
Unable to open VOC file.
*** Processing cannot continue. ***
What do you think gone wrong?
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Hi Ray,
---------------------------
CLEAR.FILE will work via ExecTCL only if the hashed file was created in an account.
If the hashed file was created in a directory you need the operating system variant (clear.file) with the pathname of the hashed file.
Code:
$DSHOME/bin/clear.file pathname
executed via ExecSH (for UNIX) or ExecDOS (for Windows).
------------------------------------
You had mentioned correctly in your last but one reply that
Clear.file works for hashed file created throught he account.
Leomauer - Can you see the hash file iname listed n the Unix Directory path you are using in clear.file command?
Ketfos
I think the file path might be incorrect. That is why it dosenot clear the file.
---------------------------
CLEAR.FILE will work via ExecTCL only if the hashed file was created in an account.
If the hashed file was created in a directory you need the operating system variant (clear.file) with the pathname of the hashed file.
Code:
$DSHOME/bin/clear.file pathname
executed via ExecSH (for UNIX) or ExecDOS (for Windows).
------------------------------------
You had mentioned correctly in your last but one reply that
Clear.file works for hashed file created throught he account.
Leomauer - Can you see the hash file iname listed n the Unix Directory path you are using in clear.file command?
Ketfos
I think the file path might be incorrect. That is why it dosenot clear the file.
Sorry for not piping up earlier, the method you need to use sounds a little hokey, but it works. What you do is create the hash file, then copy the contents of the empty hash file subdirectory into a parking space. Whenever you need to clear the hash file, simply recopy the empty DATA.30 and OVER.30 files back into the hash file subdirectory from your parking spot.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
I usually do not type the file name, but copy/paste it from the screen. Therefore the path/name is correct. When I simply recall the command and replace clear.file with ls -l i see the file.ketfos wrote:Hi Ray,
---------------------------
CLEAR.FILE will work via ExecTCL only if the hashed file was created in an account.
If the hashed file was created in a directory you need the operating system variant (clear.file) with the pathname of the hashed file.
Code:
$DSHOME/bin/clear.file pathname
executed via ExecSH (for UNIX) or ExecDOS (for Windows).
------------------------------------
You had mentioned correctly in your last but one reply that
Clear.file works for hashed file created throught he account.
Leomauer - Can you see the hash file iname listed n the Unix Directory path you are using in clear.file command?
Ketfos
I think the file path might be incorrect. That is why it dosenot clear the file.
I would like to make it work. It is a usefull feature. Our people are creating special DS jobs to load empty file into hash. I do not like it.
Ray. What does "attached to a DataStage project directory" means in layman terms?
Thanks.
In layman's terms it should mean that it would work as long as it is issued from inside a 'job', not directly from the command line. So, a piece of job control code or a routine (before job, let's say) could use DSExecute to issue the command and then it would work.
Only way I can see accomplish what Ray is saying.
Only way I can see accomplish what Ray is saying.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Code: Select all
sys="UNIX"
Command="/dsadm/Ascential/DataStage/DSEngine/bin/clear.file ":fullHashFilepathname
*Command = "ls -l ":fullHashFilepathname
Call DSLogInfo("System: ":sys, "")
Call DSLogInfo("Command: ":Command, "")
Call DSExecute(sys, Command, ScreenOutput, SystemReturnCode)
Call DSLogInfo("Return Code: ":SystemReturnCode, "")
Call DSLogInfo("UNIX output: ":ScreenOutput, "")
It works when I execute:
Command = "ls -l ":fullHashFilepathname
But when
Command="/dsadm/Ascential/DataStage/DSEngine/bin/clear.file ":fullHashFilepathname
it aborts
Yet
$ ls -l /dsadm/Ascential/DataStage/DSEngine/bin/clear.file
-rwxr-x--x 1 dsadm datastg 1562767 Dec 08 2003 /dsadm/Ascential/DataStage/DSEngine/bin/clear.file
When aborting it does not even go as far as executing last two DSLogInfo (no problem when Command is ls)
Any idea?
Thanks.