Clear Down Hashed Files
Moderators: chulett, rschirm, roy
Clear Down Hashed Files
What is the best way to clear down hashed files.
I want a stage in a LoadAllFromScratch job/sequence which first clears down the hashed files that have been populated during all development and testing.
Do i need to write this in DS basic? If so what is the command?
Cheers, Nick.
I want a stage in a LoadAllFromScratch job/sequence which first clears down the hashed files that have been populated during all development and testing.
Do i need to write this in DS basic? If so what is the command?
Cheers, Nick.
Regards,
Nick.
Nick.
or You can check the box:'Clear file before writing' in which case DS will
make sure to build the hash file from scratch emptying the contents of it.
this is will be a good option if you have many hash files to clean, this will
also give you TRUE staging solution of not storing the look-up data from
the last run.
Just a thought !! Look into one of Ken's posting which supports this.
make sure to build the hash file from scratch emptying the contents of it.
this is will be a good option if you have many hash files to clean, this will
also give you TRUE staging solution of not storing the look-up data from
the last run.
Just a thought !! Look into one of Ken's posting which supports this.
I'm using the same server job to load the one of historic load and the incremental load, just passing it different parameters. When I run the one off historic load i want to clear down the hashed files first. When I run the incremental load i don't want the hashed file cleared because I'm only appending new records to it. I'm doing it this way because I'm loading into SAP BW and don't want to extract all the records from SAP to build a new Hashed file each time the incremental load is used.
My problem now is how do i clear a hashed file from a sequencer?
Can I write a routine to do this and call the routine? if so what is the syntax/code? I keep getting compile errors.
Thanks, Nick
My problem now is how do i clear a hashed file from a sequencer?
Can I write a routine to do this and call the routine? if so what is the syntax/code? I keep getting compile errors.
Thanks, Nick
Regards,
Nick.
Nick.
The syntax to clear a hash is dependant on exactly how it was created - inside a project, using a directory path, etc. Ray (or Ken?) has an excellent post out there explaining in detail this very issue with syntax examples, the whole nine yards - but I can't seem to find it at the moment and need to get out of here.bondcaliwood wrote:Can I write a routine to do this and call the routine? if so what is the syntax/code? I keep getting compile errors.
Can you post the syntax you are using?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Add a Routine Stage to your sequence where the clear needs to take place. Create a routine with two arguments: hash file name and clear switch job parameter. Have the routine issue a "CLEAR.FILE hashfilename" statement using the API DSExecute (search this forum) with TCL as the command type if the clear switch is set for historical, otherwise, have the routine just exit peacefully.
If your hash file is externally pathed, change to using a UNIX command type and use "rm -r fullyqualifiedpathhashfilename". Make sure that the job is set to create the hash file if needed.
If your hash file is externally pathed, change to using a UNIX command type and use "rm -r fullyqualifiedpathhashfilename". Make sure that the job is set to create the hash file if needed.
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
Actually, as of 6.x at least this isn't needed. It will always create the Hash if it doesn't exist, even if the 'Create' box is not checked. So, it seems like the only reason to actually check it off nowadays is to override the defaults of a Dynamic hash.kcbland wrote:Make sure that the job is set to create the hash file if needed.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
This "feature" actually sucks, because of another problem. Sometimes, when you rename a link going into a hash file stage, it "automagically" changes the name of the hash file to that of the link. Not checking create file used to cause the job to blow up, now it silently creates the errant file and continues on its merry way. This is tragic as a previous job is responsible for the creation of the file, and subsequent jobs add to or enrich the content. Since one of them is silently adding to "another" file, you lose all of that data and never see the error. Only during System Testing and inspection of the hash file work area (now a part of a standard checklist of things to do to approve) for misnamed hash files seem to catch these errors.chulett wrote:Actually, as of 6.x at least this isn't needed. It will always create the Hash if it doesn't exist, even if the 'Create' box is not checked. So, it seems like the only reason to actually check it off nowadays is to override the defaults of a Dynamic hash.kcbland wrote:Make sure that the job is set to create the hash file if needed.
How about making buttons do what they are supposed to do? Is that toooo much to ask?
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 agree, having actually run into the exact same situation you mentioned. After much wailing and gnashing of teeth, the errant hash file was discovered and terminated with Extreme Prejudice.kcbland wrote:This "feature" actually sucks, because of another problem.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers