The first step in integrating
SAS processes with the grid is to get your SAS programs running on
the grid.
In order to submit a
SAS program to the grid, you must add a set of grid statements to
the program. For programs submitted through the SAS Program Editor,
you can save the statements to an external file and then specify a
key definition that issues the statements. Submit the contents of
the
SAS Program Editor window to the grid,
rather than to the local workstation.
Some of the examples
in this topic use
SAS/CONNECT statements (such as signon, rsubmit,
and signoff). For detailed information about these statements, see
SAS/CONNECT
User's Guide.
Note: This procedure does not work
if the
Explorer window is open in your SAS
session.
To add grid statements
to a program and submit the program to the grid, follow these steps:
-
Save these statements
to an external file, referred to as
grid-statement-file (for
example, c:\gpre.sas):
%global count;
%macro gencount;
%if %bquote(&count) eq %then %do; %let count=1;%end;%else %let
count=%eval(&count+1);
%mend;
%gencount;
options
metaserver='metadata-server-address';
options metaport=metadata-server-port;
options metauser=username;
options metapass="password";
%let rc=%sysfunc(grdsvc_enable(grid&count, server=SASApp));
signon grid&count;
metadata-server-address is
the machine name of the SAS Metadata Server, and
metadata-server-port is
the port used to communicate with the metadata server.
-
Open the
Keys window
and specify the following for an available key (for example, F12):
gsubmit ”%include
'grid-statement_file';”;
rsubmit grid&count wait=no persist=no;
grid-statement-file is
the path and filename of the file (for example, c:\gpre.sas) containing
the grid statements.
-
Type or include a SAS
program in the
Program Editor window, and
then press the key assigned to the grid statements. The program is
automatically submitted to the grid for processing. Your local machine
is busy only until the program is submitted to the grid.
Using the same key to
submit multiple jobs causes multiple jobs to be executed in parallel
on the grid. Anything specified in the WORK library is discarded when
the grid session ends and is not available to later steps in the code.