Table 11.2 Automatic Macro Variables with Host-Specific Results
List the name of the current graphics device
SYSDEVIC Read and write
List of the mode of execution (values are
FORE or BACK). Some host environments
allow only one mode, FORE.
List the name of the currently executing
batch job, user ID, or process. For example,
on UNIX, SYSJOBID is the PID.
List the last return code generated by your
host environment, based on commands
executed using the X statement in open code.
The X command in the SAS windowing
environment, or the %SYSEXEC (or %TSO
or %CMS) macro statements.
The default value is 0.
SYSRC Read and write
List the abbreviation of the host environment
that you are using.
List a more detailed abbreviation of the host
environment that you are using.
Retrieve a character string that was passed to
SAS by the SYSPARM= system option.
SYSPARM Read and write
Time zone name based on TIMEZONE
Time zone ID based on TIMEZONE option. SYSTIMEZONEIDENT Read-only
Current time zone offset based on
Examples Using SYSSCP and SYSSCPL
The macro DELFILE uses the value of SYSSCP to determine the platform that is
running SAS and deletes a TMP file. FILEREF is a macro parameter that contains a
filename. Because the filename is host-specific, making it a macro parameter enables the
macro to use whatever filename syntax is necessary for the host environment.
/* Unix */
%if &sysscp=HP 800 or &sysscp=HP 300 %then %do;
X “rm &fileref..TMP”;
/* DOS-LIKE platforms */
%else %if &sysscp=OS2 or &sysscp=WIN %then %do;
152 Chapter 11 • Writing Efficient and Portable Macros