Using SAS Display Manager with a SAS Grid

Overview

You can use SAS Display Manager as a client to submit SAS programs to the grid for execution, with the results of the execution returned to the local workstation. When you submit a SAS program from a SAS Display Manager client to execute on a grid, the program runs on a grid machine in a separate SAS session with its own unique work library. The SAS log and output of the grid execution are returned to the local workstation. You might need to perform additional actions in order to view data from the SAS Display Manager session that was created or modified by the program that ran on the grid. For example, modifications might be required in order to use the Explorer to browse SAS libraries that are modified by grid execution.

Submitting Jobs from the Program Editor to the Grid

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.
To add grid statements to a program and submit the program to the grid, follow these steps:
  1. 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, resource=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.
  2. 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.
  3. Type or include a SAS program in the Program Editor window, and then press the key to 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.

Viewing LOG and OUTPUT Lines from Grid Jobs

The example in Submitting Jobs from the Program Editor to the Grid uses asynchronous rsubmits. This causes the results of the execution to be returned to the local log and output windows only after the entire program finishes execution on the grid. To cause the log and output lines to be displayed while the program is executing, delete the options noconnectwait; line in the program.
The rsubmit executes synchronously, and the returned log and output lines are displayed while the job is executing. This also results in the Client SAS session being busy until the entire grid job has completed. You cannot submit more code until the job completes.

Using the SAS Explorer Window to Browse Libraries

The Client SAS session and the grid SAS session are two separate instances of SAS. Any code or products needed to access data must be submitted and available on both the client machine as well as the grid nodes. Use the following steps to browse libraries from the SAS Explorer Window that are accessed and modified by jobs executing in the grid:
  1. Define all of your SAS libraries within SAS metadata under your server context (for example, under SASApp).
  2. Ensure that the following option is in the SAS invocation in the sasgrid script file used to start SAS on the grid nodes. This option should have been added by the SAS Deployment Wizard.
    metaautoresources SASApp
    SASApp is the name of your application server context.
  3. Include this option on the Client SAS session invocation on the workstation.
    metaautoresources SASApp
    SASApp is the name of your application server context.
    Note: If you are accessing data through any SAS/ACCESS product, you must license the SAS/ACCESS products on the SAS Client machine in order to be able to browse those libraries from the SAS Explorer. The SAS/ACCESS products must also be licensed on the grid nodes in order to enable the job to access data during execution.
Each SAS session executing on the grid is a unique session with a unique WORK library. In order to view the work libraries that are created on each of the grid nodes, you must add the following line after the signon statement in the code provided in Submitting Jobs from the Program Editor to the Grid:
libname workgrid slibref=work server=grid&count;
grid&count is the label used as the remote session ID in the signon statement.