Previous Topic: SECURITY()Next Topic: SHOVE()


SETRC()

CA-GSS extended functions set the RC special variable upon their completion. This action permits an IMOD to test for correct execution in a straightforward manner, by checking for RC = 0 or by trapping failures with SIGNAL ON conditions. SETRC() permits an IMOD that is called as an external subroutine or function to set the RC special variable in the calling IMOD.

Syntax

oldval = SETRC([newval])

Parameters

oldval

Previously set value for the RC special variable.

newval

Value to be assigned to the RC special variable upon return from the current external subroutine or function. Specify a value from 0 to 255 (inclusive).

Default: The value is not changed, and the currently set value is returned.

Usage Notes

Example

#desc IMOD to check for palindromes 
#callable
   parse upper value arg(1) arg1
   parse upper value arg(2) arg2
   arg2 = reverse(arg2)
   if arg1 = arg2 then return 'PALINDROME'
   x = stern(200)
   return 'NOT PALINDROME'