How to Clear a Hashed File Outside of Datastage Job?

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

chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's not the problem. :? It's already been established that either of those commands work for hash files created in an account, i.e. in a project. The question of the day is how to do the same thing for explicitly pathed hash files, those created outside of the project. That would mean ones without a VOC record and (hopefully) without the need to create a VOC record on the fly.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chucksmith
Premium Member
Premium Member
Posts: 385
Joined: Wed Jun 16, 2004 12:43 pm
Location: Virginia, USA
Contact:

Post by chucksmith »

Just a reminder, if you do need to create a VOC entry, you can use my routine CreateVocPtr on the tools page of www.anotheritco.com.
Christina Lim
Participant
Posts: 74
Joined: Tue Sep 30, 2003 4:25 am
Location: Malaysia

Post by Christina Lim »

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,
It's too late to do so because the lookup looks the hashed file first and finds an entry. But that's not right. At the beginning, the hashed file should be empty in order to guarantee the correct result.
:o Can you please explain further on these senarios? It worries me now..

I have a lot of jobs which writes and lookup the the same hash file within the same job. As long as the the option to 'Clear File Before Writing' is checked or the 'Create File' option is checked, I do not see such problems discussed above is prevalent. :?
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

If you use the "Clear Hash File" check box in a job design, the hash file will be cleared when the input link starts up. Therefore, if you have a reference to that same hash file in a previous transformer stage, the hash file WILL be cleared before the first row is processed.
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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Geez Ken,

I think you are losing it.
I'm a little teapot short and stout, here is my handle, here is my spout.
Too many babies hath made thee mad.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I wasn't going to say anything. Didn't figure *I* should be one to comment about sigs. :wink:

To Ken's point, yes - but the job will fail the first time it runs unless you remember do some manual intervention. That is, if the lookup comes first and the write to the hash comes second, then the lookup will fail. Even a Validate won't create the hash for you. That's why I tend to use the 'transfomer trick' so I don't have to remember to futz with it after promotion.

Besides, at this point I think we've morphed beyond a specific example of a job to more of an exercise to make this O/S level clear.file command to work on pathed hash files.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Hey Craig,

What happens when ship carrying blue babies crashes into ship carrying red babies? Are they smurfed or marooned?

You are right I think it wise for you not to comment.
Mamu Kim
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I guess Ray's not going to come back and provide some closure for this thread. :cry:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply