Warehouse Release 3.00.1720
03/29/2003
The features in the 3.00.1720 release are:
Functions ISDIGITS, ISNUMZ, NUMZ : new functions have been added to facilitate conversions between strings and numbers. The new functions are ISDIGITS to check if a string contains only digits, ISNUMZ to check if a string contains a valid zoned decimal number and NUMZ to convert a zoned decimal string to a number. The specifics are:
ISDIGITS scans a string and returns true if all characters in the string are "0"-"9". If the string contains any characters other than "0"-"9" (including spaces) false is returned. A minimum string length may be specified. When a minimum length is specified, false is returned if the length of the string is less than minimum. A zero length string returns false,
unless a minimum length of zero was specified.
result = ISDIGITS(source-string [, minimum-length] )
source-string is the string to be checked for only digits.
minimum-length is an optional parameter that indicates the minimum length of the string. This parameter is often necessary when checking fixed length strings because spaces are truncated from a fixed length string prior to the ISDIGITS check.
Examples:
Expression Result
ISDIGITS("3141") TRUE
ISDIGITS(" 3141") FALSE
ISDIGITS("-3141") FALSE
ISDIGITS("31.41") FALSE
ISDIGITS("3141", 6) FALSE
ISDIGITS("7F") FALSE
ISDIGITS("") FALSE
ISDIGITS("", 0) TRUE
ISNUMZ determines if a string is a valid zoned decimal string that can be converted using the NUMZ function.
To be a valid zoned decimal string, all positions except the last must contain "0"-"9". The last position of the string must contain one of:
"0" - "9" : indicating an unsigned number
"{" : positive, with last digit of 0.
"A" - "I" : positive, with last digit 1-9 (A=1,I=9)
"}" : negative, with last digit 0.
"J" - "R" : negative, with last digit 1-9 (J=1,R=9)
result = ISNUMZ(source-string)
source-string is the string to be checked be a valid zoned decimal string.
Examples:
Expression Result
ISNUMZ("3141") TRUE
ISNUMZ(" 3141") FALSE
ISNUMZ("-3141") FALSE
ISNUMZ("31.41") FALSE
ISNUMZ("7F") TRUE
ISNUMZ("7Z") FALSE
ISNUMZ("}") TRUE
ISNUMZ("") FALSE
NUMZ converts a zoned decimal string to a number. See ISNUMZ above for description of a zoned decimal number.
If the string passed to NUMZ is not a valid zoned decimal string, a warning is issued and the result is undefined. (The TRY function or statement can used to catch the warning.)
result = ISNUMZ(source-string)
source-string is the string to be checked be a valid zoned decimal string.
Examples:
Expression Result
ISNUMZ("3141") 3141
ISNUMZ(" 3141") Error
ISNUMZ("7F") 76
ISNUMZ("K") -2
Release 3.00.1720 is available now on all supported platforms.