Conditional Lookups where condition references an input col

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
fridge
Premium Member
Premium Member
Posts: 136
Joined: Sat Jan 10, 2004 8:51 am

Conditional Lookups where condition references an input col

Post by fridge »

Hi,

I am probably being dense (dont all shout at once) but have a simple job

read Seqfile A do lookup (lookup based on single key value, lookup data fed into lookup stage from Sequential file B) and wanted to do the lookup ONLY if A.FIELD <> something - but when building the expression the input columns option on the dropdown list was grey-out (other options, functions, DSMacro etc all fine and dandy)

Okay ladies and gents - what am I missing
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

At this point in time ARE there any input columns to the Lookup stage?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
fridge
Premium Member
Premium Member
Posts: 136
Joined: Sat Jan 10, 2004 8:51 am

Post by fridge »

evening ray , yes there are input columns being fed into the lookup stage , this is a design rather than a runtime issue - just cant select input columns as an option from the dropdown

Actually sorted the functional issue with what is commonly known in UK as 'fudge' but in my never-ending quest for knowledge I would like to know why I cant use input columns in conditional expression, I blame myself for missing something , but again that is a UK thing
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I can't check now, but could it be related to a sparse/non-sparse lookup setting?
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

I just tried a simple job to test this:

Seq File, one field called 'Key', input to Look Up.
Seq File, two fields called 'Key', 'Data', reference to Look Up.

Perform look up between field 'Key', outputting 'Key' from input link, and 'Data' from reference link.

When I try to add a Condition I can select 'Input Column' from the list, no problems.

I'm running 7.5.1A. Sorry this isn't any help. Can you hand type the condition including the input column link and name?

Ray, not sure if the idea about Sparse look-up holds true here because we're only dealing with Sequential File, not DB stage, and sparse is set up in the directly joining stage, not the look-up stage.
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

I think Arnd is probably on the right track with sparse/non-sparse.

A flat file lookup (or non-sparse database lookup) reads the entire lookup into memory. The lookup function will be very fast... no need for a condition.

In a sparse lookup (database), individual SELECT statements are issued to the database... a very expensive operation that would benefit from being conditional.

Mike
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

My test job used Sequential Files that cannot take advantage of Sparse look-ups but I did have access to the input columns.
fridge
Premium Member
Premium Member
Posts: 136
Joined: Sat Jan 10, 2004 8:51 am

Post by fridge »

sussed it - it WAS just a case of hard coding the condition - just seems for some reason that the menu option borked

thanks for input guys
Post Reply