If 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
nvkravi
Participant
Posts: 22
Joined: Mon Jun 09, 2003 12:01 am
Location: India

If Condition...

Post by nvkravi »

How to do in DataStage the following Condition

If (DSLink1.EmpJob < 'VS_PRES') Then
DSLink3.EmpJob = "CEO" *Passing Value to Target column
V_One = "T" *Setting the variable
Else
DSLink3.EmpJob
End

Here V_One is Stage variable or parameter. That we will use in another Target Stage. And the default value of V_One = "F". In the Other Target Stage the condition is

If (V_One = "T") Then
DS_JobName
Else
V_One = "F"
End

Please note that in the else part we dont want to pass "true" value to the target column and only we want to re-set the variable.

Can any1 give suggestions how to do this? or How to process?
Thanx and Regards,
Ravi
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I am going to assume that DSLink1 is the main (stream) input to the Transformer stage, and the DSLink3 is an output link.

I will call the stage variable IsCEO rather than V_One. Derive the stage variable using the following expression:
(DSLink1.EmpJob < "VS_PRES")

Derive DSLink3.EmpJob using the following expression:
If IsCEO Then "CEO" Else DSLink1.EmpJob

Derive DSLink3.JobName using the following expression:
If IsCEO Then DSJobName Else "F"

Can you explain (in English rather than in pseudo-BASIC) what you are trying to accomplish? Really this is what you should have done first - generated a design that non-programmers could comment on and sign off as the correct business rule.

Finally, let me pre-empt all the other posters who will again point out how important it is that you undertake fundamental DataStage training. Your approach clearly shows that you are coming from a background where you're used to doing everything with scripts, rather than using a visual metaphor. Hassle your managers; it's important - vital - for someone in your position to be competent with the product!

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Post Reply