Then write a RPG function that converts the character string into a numeric
value using %DEC.
If the function crashes return 0 else 1.
Register this RPG function as SQL UDF and use it!

Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von John Yeung
Gesendet: Tuesday, 15.1 2013 18:29
An: Midrange Systems Technical Discussion
Betreff: Re: SQL is numeric function

On Tue, Jan 15, 2013 at 11:56 AM, Birgitta Hauser <Hauser@xxxxxxxxxxxxxxx>
wrote:
No, you only can check for numeric values by translating all digits
(and Decimal Point) into *Blanks and checking whether the string is not
*Blank.

This is a nice and simple method for "well behaved" data, but has
limitations. For example, it will also consider '123.4.5.6' and '12
.3 4....' to be numeric values. It also doesn't handle negative
numbers or scientific notation, which may or may not be relevant.

The lack of an IsNumeric function is a common complaint. See this article
for more information:

http://www.itjungle.com/fhg/fhg100808-printer02.html

tl;dr: Create a UDF. You'll probably need it over and over again anyway,
so in the long run you'll be glad you did.

John
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.