Hi,
How to Implement this in DataStage....
IF B_DT >= PCKG_BEGIN_DT AND B_DT <= FMC_PCKG_END_DT
THEN TYPE := 'N';
ELSIF A_END_DT >= PCKG_BEGIN_DT AND A_END_DT <= FMC_PCKG_END_DT THEN TYPE:= 'R';
ELSE TYPE:='C';
Thanks
Srini
Implementing If ElseIf End Function in DataStage
Moderators: chulett, rschirm, roy
Pretty much just like that, without the assingments and the semi-colons. The TYPE field should be the target of the derivation and use something like this:
Your dates would also need to be in a 'comparable' format, ISO compliant: YYYY-MM-DD.
Code: Select all
IF B_DT >= PCKG_BEGIN_DT AND B_DT <= FMC_PCKG_END_DT THEN 'N' ELSE IF A_END_DT >= PCKG_BEGIN_DT AND A_END_DT <= FMC_PCKG_END_DT THEN 'R' ELSE 'C'
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Note that ELSE IF is two words - there is no ELSEIF or ELIF operator. Note also that this is a value-generating expression, not a statement in a function, so that assigment operators and statement terminators are inappropriate.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
condition
chulett wrote:Pretty much just like that, without the assingments and the semi-colons. The TYPE field should be the target of the derivation and use something like this:
Code: Select all
IF B_DT >= PCKG_BEGIN_DT AND B_D ...[/quote] we can give like this if 1=1 then 100 else if 1=2 then 200 else 0
Ragu
condition
chulett wrote:Pretty much just like that, without the assingments and the semi-colons. The TYPE field should be the target of the derivation and use something like this:
Code: Select all
IF B_DT >= PCKG_BEGIN_DT AND B_D ...[/quote] we can give like this if 1=1 then 100 else if 1=2 then 200 else 0
Ragu
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
Re: condition
The result in this case will always be 100.Ragupathy wrote:we can give like this
if 1=1 then 100 else if 1=2 then 200 else 0
Btw, this thread was initiated and resolved more than 2 years ago. The poster might have moved on to new adventures.