Example: Passing a Value to a Procedure
In this example, you invoke SAS on a UNIX operating environment on September 20,
2011 (the librefs Dept and Test are defined in the config.sas file) with a command like
the following:
sas program-name -sysparm dept.projects -config /myid/config.sas
Macro variable SYSPARM supplies the name of the data set for PROC REPORT:
proc report data=&sysparm
report=test.resorces.priority.rept;
title "%sysfunc(date(),worddate.)";
title2;
title3 'Active Projects By Priority';
run;
SAS sees the following:
proc report data=dept.projects
report=test.resorces.priority.rept;
title "September 20, 2011";
title2;
title3 'Active Projects By Priority';
run;
SYSPBUFF Automatic Macro Variable
Contains text supplied as macro parameter values.
Type: Automatic macro variable (read and write, local scope)
Details
SYSPBUFF resolves to the text supplied as parameter values in the invocation of a
macro that is defined with the PARMBUFF option. For name-style invocations, this text
includes the parentheses and commas. Using the PARMBUFF option and SYSPBUFF,
you can define a macro that accepts a varying number of parameters at each invocation.
If the macro definition includes both a set of parameters and the PARMBUFF option, the
macro invocation causes the parameters to receive values and the entire invocation list of
values to be assigned to SYSPBUFF.
Note: The SYSPBUFF automatic macro variable can be modified only within the scope
that it resides. Any attempt to assign a value to SYSPBUFF within an inner scope
not already containing an instance of SYSPBUFF causes a new instance of
SYSPBUFF to be created within that inner scope.
Example: Using SYSPBUFF to Display Macro Parameter
Values
The macro PRINTZ uses the PARMBUFF option to define a varying number of
parameters and SYSPBUFF to display the parameters specified at invocation.
%macro printz/parmbuff;
%put Syspbuff contains: &syspbuff;
%let num=1;
220 Chapter 14 • Automatic Macro Variables