Function Status Codes
Dataport functions return only one output parameter, the function status code. This code reports whether the function call was successfully completed. If the function call fails, the status code indicates the problem. This status code can be used to pinpoint run-time errors in your program.
For example, assume the following call appears in your program:
The function requires a state name for the first input argument. In this case, the function returns a status code of 3,
stm_illegal_name
, because%
is not a valid element name.The status code is an integer value. Therefore, the
status
argument must be a variable declared to be of typeint
INTEGER
. The Dataport provides predefined constants for the function status codes. This enables you to use the status name attached to each status code in your program.Status codes have three severity levels:
● S for success
● W for warning
● E for errorWhen a warning or error status is returned, attempts to execute statements using the return value of the function can produce erroneous or unexpected results. Therefore, you should check the return status codes to ensure that your function call is successful before using the returned values.
The following table lists the status codes and their severity levels.
Severity Level –4 UNIX: TheSTM_ROOT
environment variable is not defined. –3 –2 –1 The long description of the specified element does not contain the given starting keyword. The lists cannot be compared because the list types are different, or the lists are not initialized. The element is defined implicitly—it is an internally defined entity. The list cannot be sorted because its elements
have no attributes.