Use of 'Not' Condition

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
sujaoschin
Premium Member
Premium Member
Posts: 102
Joined: Tue Jan 31, 2006 4:13 am

Use of 'Not' Condition

Post by sujaoschin »

INPUT COLUMN
AS_ANCESTOR PROCESS_RECORD
0
0
131
141
151

LOOKUP TABLE
BISEPS_MI_ID
6
7
8
131

My job has to populate "Y" for the Process_record column for the below condition
if Reject_As_Ancestor.AS_ANCESTOR>0 AND Reject_As_Ancestor.AS_ANCESTOR=lookup_AS_ANCESTOR1.BISEPS_MI_ID) then "Y" else INPUT.PROCESS_RECORD==>Populating 'Y' correctly


Another condition is
My job has to populate "R" for the Process_record column for the below condition

i.e. if the input column (AS_ANCESTOR) > 0 AND Input (AS_ANCESTOR) value is not equal to lookup value of BISEPS_MI_ID.

if Reject_As_Ancestor.AS_ANCESTOR>0 AND NOT(Reject_As_Ancestor.AS_ANCESTOR=lookup_AS_ANCESTOR1.BISEPS_MI_ID) then "R" else Reject_As_Ancestor.PROCESS_RECORD==>this expression is not working.

Please let me know what I need to give to make the "R" condition to work.
Sujatha K
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If the lookup link is serviced by a hashed file, then you can use the NOTFOUND link variable for the reference input link. Otherwise use

Code: Select all

Not(IsNull(RefInput.BISEPS_MI_ID) And (InLink.AS_ANCESTOR > 0)
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 »

'Lookup Table' means what? Hashed file, database or ?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sujaoschin
Premium Member
Premium Member
Posts: 102
Joined: Tue Jan 31, 2006 4:13 am

Post by sujaoschin »

My lookup is a hash file.
Sujatha K
sujaoschin
Premium Member
Premium Member
Posts: 102
Joined: Tue Jan 31, 2006 4:13 am

Post by sujaoschin »

Ray,
Please let me know how to use the NOTFOUND variable.
Sujatha K
sujaoschin
Premium Member
Premium Member
Posts: 102
Joined: Tue Jan 31, 2006 4:13 am

Post by sujaoschin »

Hi Ray,

I tried like below it is not working.
if (NOT(Reject_As_Ancestor.AS_ANCESTOR=lookup_AS_ANCESTOR1.BISEPS_MI_ID)) AND (Reject_As_Ancestor.AS_ANCESTOR>0) then "R" else Reject_As_Ancestor.PROCESS_RECORD

Please let me know how to do it.
Sujatha K
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

sujaoschin wrote:Ray,
Please let me know how to use the NOTFOUND variable.

Code: Select all

(RefInput.NOTFOUND) And (InLink.AS_ANCESTOR > 0)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sujaoschin
Premium Member
Premium Member
Posts: 102
Joined: Tue Jan 31, 2006 4:13 am

Post by sujaoschin »

Hi Ray,

I tried like below now using NOTFOUND for the stage variable(vRecordStatus) in transfomer, it is not accepting (HIGHLIGHTING IN RED)

if (Reject_As_Ancestor.AS_ANCESTOR.NOTFOUND) AND (Reject_As_Ancestor.AS_ANCESTOR>0) then "R" else Reject_As_Ancestor.PROCESS_RECORD.

Please let me know what is the mistake I am doing.

Here Inlink name is Reject_As_Ancestor. Lookup hash link name is lookup_AS_ANCESTOR1 ( where it has the columns of BISEPS_MI_ID, ASSETNUM).
Sujatha K
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You have two dots, I have one. Choose "Link Variables" from the operand menu in the expression editor, choose "Inputs..." from the next menu that is presented, and choose the NOTFOUND link variable for the reference input link from the list that is then presented.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sujaoschin
Premium Member
Premium Member
Posts: 102
Joined: Tue Jan 31, 2006 4:13 am

Post by sujaoschin »

Thank you so much, Ray. It worked when I gave the command like below

if( lookup_AS_ANCESTOR1.NOTFOUND) AND (Reject_As_Ancestor.AS_ANCESTOR>0) then "R" else Reject_As_Ancestor.PROCESS_RECORD

The problem got resolved.
Sujatha K
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The reason I asked hashed v. database is the use of the NOTFOUND link variable only works reliably for a hashed file. Something to keep in mind.
-craig

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