Sets the current value of the ONSOURCE built-in function.
ONSOURCE() = string
or
ONSOURCE = string
The second syntax form can be used only when ONSOURCE has been explicitly declared using the BUILTIN attribute.
DCL I FIXED BIN(15); ON CONVERSION BEGIN; ONSOURCE() = '0'; END; I = STRING VALUE; PUT LIST(I);
If STRING_VALUE contains an invalid character, use of the ONSOURCE pseudovariable in the above example resets STRING_VALUE to zero. Therefore, the program will display an integer value of 0.
None.
Description
The ONSOURCE pseudovariable is used to replace the invalid string that caused the CONVERSION condition to be raised. This new string is used when the conversion is attempted again.
The ONSOURCE pseudovariable is valid only in the context of a CONVERSION ON-unit. In all other cases, the ONSOURCE pseudovariable is ignored.