Key Expression

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
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Key Expression

Post by cosec »

Hi,

I have two Keys in My Lookup Table. I Load My input data only by checking the first column in the lookup table. The value of the other column is used for calculations. It is highligted in red...how can i correct this ?
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

If you don't want to use the second column in the lookup table, then uncheck key option for that column. Isn't it that easy? That will get rid of your "highlighted in red" problem. Plus you can retrieve the second column as an output incase of a successful look up and use for your calculations further.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
singhald
Participant
Posts: 180
Joined: Tue Aug 23, 2005 2:50 am
Location: Bangalore
Contact:

Post by singhald »

Hi Buddy,

you can only make thouse column key which you are using to lookup(mapping). just make your red column to not-key column in table definition. thats all.

it will not show that coloumn in red.

Deepak
Regards,
Deepak Singhal
Everything is okay in the end. If it's not okay, then it's not the end.
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Re: Key Expression

Post by cosec »

unfortunately it's not that straight forward....I have tried it that way...but when I uncheck it the Hash File does not get updated.
cosec wrote:Hi,

I have two Keys in My Lookup Table. I Load My input data only by checking the first column in the lookup table. The value of the other column is used for calculations. It is highligted in red...how can i correct this ?
shiva459
Premium Member
Premium Member
Posts: 100
Joined: Wed Jun 11, 2003 1:49 am
Location: Bangalore

Post by shiva459 »

Based on your reply,I'm assuming your lookup data is in the hashed file. You cannot change the keys in hashed file. If you have defined two columns as key columns while loading you have to use the same columns as keys while reading. Else, you will get incorrect data.

Other option will be to load data into a table without constraints and have non-unique index defined on the lookup column.
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Post by cosec »

Hi Shiva,
I need to change the value of the incoming second key based on the look up....and havent figured it out yet...trying different scenarios
shiva459 wrote:Based on your reply,I'm assuming your lookup data is in the hashed file. You cannot change the keys in hashed file. If you have defined two columns as key columns while loading you have to use the same columns as keys while reading. Else, you will get incorrect data.

Other option will be to load data into a table without constraints and have non-unique index defined on the lookup column.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The second key is red because the GUI doesn't permit doing this. Even so, it will compile and run successfully if the key expression is syntactically valid. Right click and choose Validate Expression.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
cosec
Premium Member
Premium Member
Posts: 230
Joined: Tue May 08, 2007 8:10 pm

Post by cosec »

Well the syntax is all fine....but the thing is I dont want the second key to be validated just want it passed to the output....


ray.wurlod wrote:The second key is red because the GUI doesn't permit doing this. Even so, it will compile and run successfully if the key expression is syntactically valid. Right click and choose Validate Expressio ...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then you'll need to use a UV stage over the top of the Hashed File. Hashed files require all Key fields to be use. All.
-craig

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