Hash File useage
Moderators: chulett, rschirm, roy
Hash File useage
Can a hash file be created and used in the same jobstream ie create hash file from oracle 9i and lookup in transform of teradata?
mcolen,
yes, you can write to and read from a hash file in the same job, just make sure that you have buffering on both writes and reads turned off.
yes, you can write to and read from a hash file in the same job, just make sure that you have buffering on both writes and reads turned off.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Hash File useage
Arnd
While I know you can read and write it in the same job I am seeing jobs for the first time creating a file and trying to use it at the same time and was wondering if this is correct.
While I know you can read and write it in the same job I am seeing jobs for the first time creating a file and trying to use it at the same time and was wondering if this is correct.
Yes, even if the file is being created in the same job it will work, provided the stage that creates the file is in the stream before the stage that reads from it.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
You can start an input stream with a Transformer under certain circumstances and that's what you need to do here.
Add a Transformer and a link to the reference hash. A transformer can be used to generate data as long as you define a stage variable in it (don't need to use it, just define it) and then constrain the number of output rows or it will run forever. So...
Populate the link with the same column metadata that your hash needs. Doesn't matter what you put in the derivation fields but obviously you need to put something there. Set an @FALSE constraint on the link so no rows ever go down it. However, its presence will tell DataStage that you need to write to it before the reads happen and you can use that link to create the hashed file on the first run or to clear it at the beginning of a run.
Hope that makes sense.
Add a Transformer and a link to the reference hash. A transformer can be used to generate data as long as you define a stage variable in it (don't need to use it, just define it) and then constrain the number of output rows or it will run forever. So...
Populate the link with the same column metadata that your hash needs. Doesn't matter what you put in the derivation fields but obviously you need to put something there. Set an @FALSE constraint on the link so no rows ever go down it. However, its presence will tell DataStage that you need to write to it before the reads happen and you can use that link to create the hashed file on the first run or to clear it at the beginning of a run.
Hope that makes sense.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers