Chapter Contents |
Previous |
Next |
IORCMSG |
Category: | SAS File I/O |
Syntax | |
Arguments | |
Details | |
Examples |
Syntax |
character-variable=IORCMSG() |
Tip: | If the length has been previously defined, the result will be truncated or padded as needed. |
Default: | The default length is 200 characters. |
Details |
The IORCMSG function returns the formated error message associated with the current value of the automatic variable _IORC_ . The _IORC_ variable is created when you use the MODIFY statement, or when you use the SET statement with the KEY= option.
Examples |
In the following program, observations are either rewritten or added to the updated master file that contains bank accounts and current bank balance. The program queries the _IORC_ variable and returns a formatted error message if the _IORC_ value is unexpected.
libname bank 'SAS-data-library'; data bank.master; set bank.trans; modify bank.master key=Accountnum; if (_IORC_ EQ %sysrc(_SOK)) then do; balance=balance+deposit; replace; end; else if (_IORC_ = %sysrc(_DSENOM)) then do; balance=deposit; output; _error_=0; end; else do; errmsg=IORCMSG(); put 'Unknown error condition:' errmsg; end; run;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.