I created a UDF to check to see if an alphanumeric phone number is toll-free. When I hardcode a parameter such as '800' it doesn't work (returns false, '0'). When I pass in a variable that contains '800', it does work (returns true, '1').

Here is my Function:
Create or Replace Function ccdlib/isTollFree ( ANI Char(20) )
returns Char(1)
language rpgle
no sql
external name 'CCDLIB/ANIPROCS($ISTOLLFREE)'
parameter style general

The service program procedure's prototype:
// Is the Number Toll-Free?
D $isTollFree PR n
D NPA 20a Const

Am I doing something wrong?

I tried changing the function parameter to VarChar, but that didn't resolve the issue.

Thanks,
Kurt Anderson
Sr. Programmer/Analyst
CustomCall Data Systems

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].