String To Number Problem

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
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

String To Number Problem

Post 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
Jim Stewart
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try

Code: Select all

Not(Not(Field(GetXrefHistCnt.uvXREF_5PK_FND_CNT,',',1)))
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply