Extracting data driven by a values in a hash file?

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
PilotBaha
Premium Member
Premium Member
Posts: 202
Joined: Mon Jan 12, 2004 8:05 pm

Extracting data driven by a values in a hash file?

Post by PilotBaha »

I have the following job structure.

HASH FILE
|
| DsLink1
|
TRANSFORMER --------->>> Hash File
^
|
|DSLink2
|
|
ODBC

I just want to be able to extract data from the ODBC stage using a query similar to

SELECT * from ODBC_Table
where OT_ITCGY = '1'AND
OT_ITEM <= DSLink1.UpperLimit AND
OT_ITEM >= DSLink1.LowerLimit;

The ODBC stage and the HashFile Stage doesn't share a common key.

Eventually I can eliminate the HashFile stage and hard code the join myself in ODBC stage itself, but what's the fun of doing that? :)

I hope the question is clear enough..

Thanks.

[/img][/list]
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This should work. For each row in the hashed file there is a set of two columns possibly called UpperLimit and LowerLimit.

DSLink1 is the stream input and DSLink2 is a reference input link.
You can constrain which rows are delivered from the hashed file using the Selection tab; if you don't use the Selection tab then check the "record level read" check box.

UpperLimit and LowerLimit in the ODBC table are asserted to be keys (whether or not they are not).

Check the "multi-row return" check box.

If the target hashed file is the same as the source hashed file, you need to ensure that the key column value is passed through the job design, and that metadata match in both hashed file stages.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply