|
|
| |
 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_DATATYPE
Purpose
Determine if a variable represents a table, numeric string, or character data.
Format
@DTW_DATATYPE(var, type)
@DTW_rDATATYPE(var)
Parameters
Table 1. DTW_DATATYPE Parameters
| Data Type
|
Parameter
|
Use
|
Description
|
|
any type
|
var
|
IN |
A variable or literal string. |
| string |
type
|
OUT |
A variable that contains "NUM" if
var represents an integer, the value "TABLE" if
var represents a table, or the value "STRING" if
var represents character data.
|
Return Codes
Table 2. DTW_DATATYPE 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. |
| 1006 |
A literal string was passed on a function call for a parameter which was required to be an output parameter. |
Usage Notes
- If the value of the input variable contains whitespace, the variable will not be considered an integer.
- An integer can be preceeded by a plus (+) or minus (-) sign.
Examples
-
@DTW_DATATYPE(inputval, type)
%IF (type == "NUM")
@handleNumeric(inputval)
%ELIF (type == "STRING")
@handleString(inputval)
%ELSE
Error: input must be a numeric or string value
%ENDIF
|
| |
|
|
|