Page 1 of 1

String To Number Problem

Posted: Fri Oct 11, 2013 10:58 am
by Raftsman
I am trying to use the Nested_Condition in a sequencer to route processing. When I use the following logic, I can't seem to get a valid indicator of 1 or 0 to return;

Field(GetXrefHistCnt.uvXREF_5PK_FND_CNT,',',1) where

GetXrefHistCnt.uvXREF_5PK_FND_CNT = 1

when I use Field(GetXrefHistCnt.uvXREF_5PK_FND_CNT,',',1) > 0. it fails because 1 is referred to as a string. I tried adding the Num function but 0 returns.

Is there an alternative to ensure that 0 and 1 returns.

Thanks

Posted: Fri Oct 11, 2013 12:06 pm
by Mike
Since you're working with DataStage BASIC, you can add zero to a string value to force a numeric comparison.

Something like:

Code: Select all

Field(GetXrefHistCnt.uvXREF_5PK_FND_CNT,',',1) + 0 > 0
Mike

Posted: Fri Oct 11, 2013 3:18 pm
by ray.wurlod
Try

Code: Select all

Not(Not(Field(GetXrefHistCnt.uvXREF_5PK_FND_CNT,',',1)))