Friday, June 6, 2014

SYSCC - bridge between SAS and OS

SYSCC automatic macro variable plays important role in the communication between SAS and the operating environment.

To use it efficiently, please keep in mind the points at below:
1. SYSCC will take only integer value, even for decimal value. Furthermore, it will prompt error when non-numeric value is assigned.
42   %let syscc=-1.3;
43   %put &=syscc;
SYSCC=-1
44   %let syscc=test;
ERROR: The value supplied for assignment to the numeric automatic macro variable SYSCC was out of range or could not be converted to a numeric value.

2. SYSCC code will be translated to a return code on SAS exit. For more information, please see host-specific features of the SAS language.
3. SYSCC always take bigger numeric value, which means it retains highest error code in the end.
4. When SYSCC has error code (>=5), it does NOT stop executing any subsequent SAS statements while ABORT statement does.