problem in lookup logic

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
ravij
Premium Member
Premium Member
Posts: 170
Joined: Mon Oct 10, 2005 7:04 am
Location: India

problem in lookup logic

Post by ravij »

Hi all,

I have a problem with my lookup logic. I am not able to implement the lookup logic in the job. The lookup code is given below.
Lookup OU to get OU_ID by condition

If Mid(FI_HOST_YYYYMMDD.TO,6,3) = 'นท.' Then

Concatenate('บน.', Concatenate(Mid(FI_HOST_YYYYMMDD.MORP,2,1), '.', Right((FI_HOST_YYYYMMDD.MORP),1)) ) = OU.ALS_NM1
and Right((OU.ALS_NM1),1) <> '.'

Else

Concatenate( '(', Mid(FI_HOST_YYYYMMDD.TO,6,3), ')' ) = Right((OU.ALS_NM1),5)

End IF
In that code i have two sources
1) FI_HOST its a file
2) OU its a table.
The output of this logic(OU_ID) goes thru Hashed file into Trnsf stage. Please help me how to develop this logic in DataStage Server job.

Thanks in advance.
Ravi
WoMaWil
Participant
Posts: 482
Joined: Thu Mar 13, 2003 7:17 am
Location: Amsterdam

Post by WoMaWil »

This is no universe code.

What do you realy want to do?

Вы хотите сделать? Опишите с словами.
Wolfgang Hürter
Amsterdam
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The lookup is performed, unconditionally (you get no choice on this) in a Transformer stage with a reference input.

The same Transformer stage can be used to perform the derivation of your output column. However, your logic is not clear. Use the Expression Editor to build your expression, noting that there is no Mid() function (you need to use Substring) and there is no assignment - it is a single line expression that you construct. Concatenate is an operator. Construct something like the following:

Code: Select all

If FI_HOST_YYYYMMDD.TO[6,3] = 'นท.' Then 'นท.' : FI_HOST_YYYYMMDD.MORP[2,1] : '.' : Right(FI_HOST_YYYYMMDD.MORP,1) Else '(' : FI_HOST_YYYYMMDD.TO[6,3] : Right(OU.ALS_NM1,5)
Last edited by ray.wurlod on Sat Dec 22, 2007 1:21 am, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ravij
Premium Member
Premium Member
Posts: 170
Joined: Mon Oct 10, 2005 7:04 am
Location: India

Post by ravij »

I have one doubt. When I run my job with prev logic which mentioned in above post, I am getting records into Hash file(With Only 1col(OU_ID) but not passing those records to transformer stage.
Do we must have Key col in output link in hash file to get the data into next stage(Transf stage)?

Thanks in advane.
Ravi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It's clear that I don't understand your logic - my guess was off the mark. Please write out a specification in English of what is supposed to happen - don't mention DataStage, hashed files or anything else in the specification.

For now I will ignore the question about the hashed file.

Have you ever undertaken a DataStage training class? Was it one of the vendors' (IBM's) classes, or some other?
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