v The instruction processed as a result of the condition trap (CALL or SIGNAL)
v The status of the trapped condition.
To select the information to return, use the following options. (Only the capitalized and highlighted letter is
needed; all characters following it are ignored.)
Condition name
returns the name of the current trapped condition.
Description
returns any descriptive string associated with the current trapped condition. If no description is
available, returns a null string.
Instruction
returns either CALL or SIGNAL, the keyword for the instruction processed when the current condition
was trapped. This is the default if you omit option.
Status
returns the status of the current trapped condition. This can change during processing, and is
either:
ON - the condition is enabled
OFF - the condition is disabled
DELAY - any new occurrence of the condition is delayed or ignored.
If no condition has been trapped, then the CONDITION function returns a null string in all four cases.
Here are some examples:
CONDITION() -> 'CALL' /* perhaps */
CONDITION('C') -> 'FAILURE'
CONDITION('I') -> 'CALL'
CONDITION('D') -> 'FailureTest'
CONDITION('S') -> 'OFF' /* perhaps */
Note: The CONDITION function returns condition information that is saved and restored across subroutine
calls (including those a CALL ON condition trap causes). Therefore, after a subroutine called with
CALL ON trapname has returned, the current trapped condition reverts to the condition that was
current before the CALL took place (which may be none). CONDITION returns the values it
returned before the condition was trapped.
COPIES
COPIES(string,n)
returns n concatenated copies of string. The n must be a positive whole number or zero.
Here are some examples:
COPIES('abc',3) -> 'abcabcabc'
COPIES('abc',0) -> ''
C2D (Character to Decimal)
C2D(string
,n
)
returns the decimal value of the binary representation of string. If the result cannot be expressed as a
whole number, an error results. That is, the result must not have more digits than the current setting of
NUMERIC DIGITS. If you specify n, it is the length of the returned result. If you do not specify n, string is
processed as an unsigned binary number.
Functions
Chapter 14. Functions 179