Unable to get the expected result

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
chowmunyee
Participant
Posts: 32
Joined: Wed Dec 28, 2005 9:02 pm

Unable to get the expected result

Post by chowmunyee »

Hi all,

I encountered a very strange problem. When i write this logic
If (A.code= "C") Then "THis C" Else If (A.code= "P") Then "This is P" Else "This is CP"

but the answer for my data are all "This is CP" but this is not suppose to have because my input data is

code
---
CP
CP
P
C
P
C
CP
CP
CP
CP
P
P
P
P
C
C

Is it my logic having problem or.....? the code is character data type. I have use UpCase, trim , ' ' and <> but everything does not work. Please help

Thank you
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If it is character trim should work.
Else If your field length is 2, then try
If (A.code= "C ") Then "THis C" Else If (A.code= "P ") Then "This is P" Else "This is CP"
Space after "C " and "P "
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chowmunyee
Participant
Posts: 32
Joined: Wed Dec 28, 2005 9:02 pm

Post by chowmunyee »

kumar_s wrote:If it is character trim should work.
Else If your field length is 2, then try
If (A.code= "C ") Then "THis C" Else If (A.code= "P ") Then "This is P" Else "This is CP"
Space after "C " and "P " ...
Yes, It is a trim issue....thanx a lot!
Post Reply