Target as Lookup

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

Post Reply
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Target as Lookup

Post by jerome_rajan »

Hi,

We have a job that looks up from the same table that the job is loading into. Something like this.

Code: Select all

                         Table A
                             |
                             |
                             |
                         Hash File
                             |
                             |
              SrcFile---->Transformer-------->Table A

Is this a good/correct practice? Won't the target keep changing even while it is being used as reference due to the pipe-lining of data? Will this produce correct results?
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That is a perfectly good practice. The output of a passive stage (such as a hashed file stage) is not opened until its input is closed. The contents of Table A are loaded into the hashed file before anything else happens.

If you want to be able to look up against changes too, you need to implement a design that also writes to the hashed file, and make use of the "lock for updates" property whether or not you're using caching.

Code: Select all

         TableA  ---->   HashedFile
                              |
                              |
                              V
         SrcFile  ---->  Transformer  ---->  TableA
                              |
                              |
                              V
                         HashedFile
Pet peeve: it's properly "hashed" file, not "hash" 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ray's illustrated technique is akin to a "Dynamic Lookup" in Informatica, if that helps or means anything to anyone playing along from home. :wink:
-craig

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