Page 1 of 1

hashfile in shared container

Posted: Fri Apr 30, 2004 1:00 am
by nilotpalr
Hi,
As per a design directive I need to use hashfiles as lookups. So I have to pre-load my oracle dimension table in a hashfile.

I proceeded the following way:
1) Created a shared container where I did the following:
OCI -------> Transformer ----------------> Hashfile
Hashfile stage has following settings:
- Allow Stage write Cache
- Clear file before writing
2) Then I am using the shared container as a lookup in my job

I am getting the following error when I try to compile my job:
Container Stage Output link count does not match number of links in the shared container.

Please help

Posted: Fri Apr 30, 2004 1:46 am
by ray.wurlod
Your shared container must have a means of sending its results out. You need something like this:

Code: Select all

   ++++++++++++++++++++++++++++++++++++++++++++++
   + OCIStage  ---->  HFStage   ----->  COutput +
   +           lk1                lk2           +
   ++++++++++++++++++++++++++++++++++++++++++++++
where COutput is a "Container Output" stage.
In your job design, you have:

Code: Select all

                    Container
                       |
                       |  lk2
                       V
SourceStage -----> Transformer  ----->  OtherStages

Posted: Fri Apr 30, 2004 3:37 am
by nilotpalr
Hi Ray,
Pls correct me if i am wring. What I have understood from your tip is that If i create a physical file(hash) then I should be fine. I could not understand the - "container must have a means of sending its results out". If I amcreating the hashfile physically then it is available to me .

Am I missing something..

Pls advice.

thanks,

Posted: Fri Apr 30, 2004 6:37 am
by chulett
nilotpalr wrote:Pls correct me if i am wring. What I have understood from your tip is that If i create a physical file(hash) then I should be fine. I could not understand the - "container must have a means of sending its results out".
No, there's more to it than simply creating the hash file in the Shared Container. What Ray is trying to point out is the need to have some way to pull data 'out' of the Shared Container, not just simply (in essence) put data in it when you want to use the Hash in it as a lookup. He wanted to know if you have a Container Output stage in your Shared Container. Also, in order for you to use it as a lookup, the connector to the Output stage must be a Reference link, not a Stream link. If the line is solid instead of dashes then right-click on it and select 'Convert to Reference'.

Once those are in place, you should be fine I would think.

Posted: Fri Apr 30, 2004 6:39 am
by WoMaWil
The philesophy of DataStage is to have Stages which are linked via links. Via this link data are flowing.

With a Container (shared or local) you have the opportunity to hide one or more Stages within such a Container.

If you use your container in a Job you must link the input or the output or both to a dataStream within Your Job, for example via a Reference Stream to you container as Ray illustrated with a high grade of details.

What you can do alternativly is to have a Job1 which fills your HashFile from Oracle and a Job2 to Jobn which uses the HashFile of Job1, therefore you need no container.

If you place your container without link in your job and you use also the same hashfile in your main stream, both activities will start at the same time and this doesn't fit your needs.

So follow the way Ray told you. In Ray you can trust.

Wolfgang

Posted: Fri Apr 30, 2004 6:02 pm
by ray.wurlod
WoMaWil wrote:In Ray you can trust.
Luckily I know Wolfgang isn't in the USA, otherwise I'd be forced to comment that this is a bit unnecessarily messianic! :wink: