Skip to main content

 
IBM Power Systems software  >  IBM i  > Software  > 

Net.Data for i5/OS

  

Here is the description of the function (this function is not yet in the Net.Data Reference manual). Available on V4R4 and subsequent releases. Ensure you have the latest Net.Data PTF.

DTW_ISNUMERIC

Purpose
Determines if a string represents an integer.

Format
@DTW_ISNUMERIC(var, result)
@DTW_rISNUMERIC(var)

Parameters
Table 1. DTW_ISNUMERIC Parameters

Data Type Parameter Use Description
string var IN A variable or literal string
string result OUT A variable that will contain the value of "YES" if var represents an integer, or "NO" if var does not represent an integer.

Return Codes
Table 2. DTW_ISNUMERIC Return Codes
Return Code Explanation
-1001 The server could not process a Net.Data request to allocate memory.
1003 The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function.
1005 A parameter passed on a function call, required to be a string variable,was of a different variable type.
1006 A literal string was passed on a function call for a parameter which was required to be an output parameter.

Usage Notes

  1. If the value of the input variable contains whitespace, the variable will not be considered an integer.
  2. An integer can be preceeded by a plus (+) or minus (-) sign.

Examples

  1.    %IF (@DTW_rISNUMERIC(inputval) == "yes")
          @sqlcall(inputval)
       %ELSE
          <p>Error:  input must be a numeric value</p>
    
       %ENDIF