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
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Sun Feb 14, 2016 11:01 am
That just needs to be
one if-then-else, specifically the last one.
-craig
"You can never have too many knives" -- Logan Nine Fingers
naveenkumar.ssn
Participant
Posts: 36 Joined: Thu Dec 03, 2009 9:11 pm
Location: Malaysia
Post
by naveenkumar.ssn » Sun Feb 14, 2016 8:36 pm
Code: Select all
IF isnotNull(FROM_ACCT_NUM)
then right(FROM_ACCT_NUM,2)
else if
isnotNull(FROM_ACCT_NUM)
then right(FROM_ACCT_NUM,2):'XXXXX'
else if
isnotNull(FROM_ACCT_NUM)
then left((right(FROM_ACCT_NUM,2):'XXXXX'):FROM_ACCT_NUM,12) ELSE
FROM_ACCT_NUM
Naveen Kumar
Datastage Consultant
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Sun Feb 14, 2016 9:08 pm
Most of your ELSE expressions won't be evaluated because they include the same IF test as was processed in the THEN clause.
All you need is:
Code: Select all
If IsNotNull(InLink.ACCT_NUM) Then Left(InLink.ACCT_NUM,2) : "XXXXX" : Right(InLink.ACCT_NUM,12) Else InLink.ACCT_NUM
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Sun Feb 14, 2016 11:34 pm
In other words... the last one.
-craig
"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607 Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:
Post
by ray.wurlod » Mon Feb 15, 2016 4:13 pm
... except that the syntax given by naveenkumar.ssn (even in the last one) will not create the required result.
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
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Mon Feb 15, 2016 4:57 pm
... was going to let them realize and attempt to correct that. Was also going to go back and edit my answer to say 'a variation of the last one' but decided to just let it stand.
-craig
"You can never have too many knives" -- Logan Nine Fingers
skp
Premium Member
Posts: 135 Joined: Wed Dec 26, 2007 1:56 am
Location: India
Post
by skp » Wed Feb 17, 2016 2:49 am
Hi Hargun,
Please use below logic to get the desired output.
If IsNotNull(FROM_ACCT_NUM) Then Left(FROM_ACCT_NUM,2):'XXXXX':Right(FROM_ACCT_NUM,12) Else FROM_ACCT_NUM
qt_ky
Premium Member
Posts: 2895 Joined: Wed Aug 03, 2011 6:16 am
Location: USA
Post
by qt_ky » Wed Feb 17, 2016 7:31 am
Ray has already given that answer above...
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Wed Feb 17, 2016 10:46 am
Seems to be a bit of a serial repeater.
-craig
"You can never have too many knives" -- Logan Nine Fingers