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
vskr72
Premium Member
Posts: 128 Joined: Wed Apr 28, 2004 9:36 pm
Post
by vskr72 » Sun Jan 08, 2012 10:35 pm
I have a column (loast column) coming from a flat file (fixed width). I am doing an integer validation for it using the below statement:
Code: Select all
If IsValid("int32", Col) then 'Valid' else 'invalid'
The values in the source file are between 0 to 5. I was expecting the output to be 'Valid'. But surprisingly its 'Invalid'. Not sure if I am doing anything wrong.
pandeesh
Premium Member
Posts: 1399 Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU
Post
by pandeesh » Mon Jan 09, 2012 1:23 am
Are you sure that , the column contains a single digit only? i believe there's some non printable characters after that.
try:
Code: Select all
If IsValid("int32", trim(Col)) then 'Valid' else 'invalid'
pandeeswaran
premupdate
Participant
Posts: 47 Joined: Thu Oct 04, 2007 3:37 am
Location: chennai
Post
by premupdate » Tue Jan 10, 2012 3:48 am
The output of IsValid function is either 1 or 0.Change the derivation accordingly.
Cheers,
prem
pandeesh
Premium Member
Posts: 1399 Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU
Post
by pandeesh » Tue Jan 10, 2012 4:01 am
premupdate wrote: The output of IsValid function is either 1 or 0.Change the derivation accordingly.
Not necessary to change!
As you said it returns true or false.
If true then valid else invalid.
pandeeswaran
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Tue Jan 10, 2012 7:42 am
So, what was the actual resolution? Posting that information helps future searchers...
-craig
"You can never have too many knives" -- Logan Nine Fingers