Submitting Batch SAS Jobs to the Grid

Overview

SAS Grid Manager Client Utility is a command-line utility that enables users to submit SAS programs to a grid for processing. This utility allows a grid client to submit SAS programs to a grid without having SAS installed on the machine performing the submission. It also enables jobs to be processed on the grid without requiring that the client remain active. You can use the command to submit jobs to the grid, view job status, retrieve results, and terminate jobs.
Most of the options that are used by the SAS Grid Manager Client Utility are contained in the sasgsub.cfg file. This file is automatically created by the SAS Deployment Wizard. These options specify the information that the SAS Grid Manager Client Utility uses every time it runs.

Submitting Jobs Using the SAS Grid Manager Client Utility

To submit a SAS job to a grid using the SAS Grid Manager Client Utility, change to the <configuration_directory>/Applications/SASGridManagerClientUtility/<version> directory and issue the following command from a SAS command line:
SASGSUB -GRIDSUBMITPGM sas-program-file
The -GRIDSUBMITPGM option specifies the name and path of the SAS program that you want to submit to the grid.
In addition, you can specify other options that are passed to the grid or used when processing the job, including workload resource names. For a complete list of options, see SASGSUB Syntax: Submitting a Job.

Viewing Job Status Using the SAS Grid Manager Client Utility

After you submit a job to the grid, you might want to check the status of the job. To check the status of a job, change to the <configuration_directory>/Applications/SASGridManagerClientUtility/<version> directory and issue the following command from a command line:
SASGSUB -GRIDGETSTATUS [job-ID | ALL]
-GRIDGETSTATUS specifies the ID of the job you want to check, or ALL to check the status of all jobs submitted by your user ID. For a complete list of options, see SASGSUB Syntax: Viewing Job Status.
Note: For the job status to be reported correctly, make sure that the sasgrid command file is updated on all grid nodes. The file is updated by the installation process for the second maintenance release after SAS 9.2. See Modifying the SASGRID Script File for more information.
The following is an example of the output produced by the SASGSUB -GRIDGETSTATUS command.
Current Job Information
  Job 1917 (testPgm) is Finished:  Submitted: 08Dec2008:10:28:57, Started: 08Dec2008:10:28:57 on Host host1, Ended: 08Dec2008:10:28:57
  Job 1918 (testPgm) is Finished:  Submitted: 08Dec2008:10:28:57, Started: 08Dec2008:10:28:57 on Host host1, Ended: 08Dec2008:10:28:57
  Job 1919 (testPgm) is Finished:  Submitted: 08Dec2008:10:28:57, Started: 08Dec2008:10:28:57 on Host host1, Ended: 08Dec2008:10:28:57
  Job information in directory U:\pp\GridSub\GridWork\user1\SASGSUB-2008-11-24_13.17.17.327_testPgm is invalid.
  Job 1925 (testPgm) is Submitted: Submitted: 08Dec2008:10:28:57

Ending Jobs Using the SAS Grid Manager Client Utility

If a job that has been submitted to the grid is causing problems or otherwise needs to be terminated, use the SAS Grid Manager Client Utility to end the job. Change to the <configuration_directory>/Applications/SASGridManagerClientUtility/<version> directory and issue the following command from a command line:
SASGSUB -GRIDKILLJOB [job-ID | ALL]
-GRIDKILLJOB specifies the ID of the job you want to end, or ALL to end all jobs submitted by your user ID. For a complete list of options, see SASGSUB Syntax: Ending a Job.

Retrieving Job Output Using the SAS Grid Manager Client Utility

After a submitted job is complete, use the SAS Grid Manager Client Utility to retrieve the output produced by the job. Change to the <configuration_directory>/Applications/SASGridManagerClientUtility/<version> directory and issue the following command from a command line:
SASGSUB -GRIDGETRESULTS [job-ID | ALL] [-GRIDRESULTSDIR directory ]
-GRIDGETRESULTS specifies the ID of the job whose results you want to retrieve, or you can specify ALL to retrieve the results from all jobs submitted by your user ID.
-GRIDRESULTSDIR specifies the directory in which the jobs results should be moved. When the results are retrieved, they are removed from the GRIDWORK directory, which keeps this directory from filling up with completed jobs.
A file named job.info is created along with the job output. This file contains information about the execution of the job, including the submit time, start time, and end time, the machine on which the job ran, and the job ID.
The following is an example of the output produced by the SASGSUB -GRIDGETRESULTS command.
Current Job Information
  Job 1917 (testPgm) is Finished:  Submitted: 08Dec2008:10:53:33, Started: 08Dec2008:10:53:33 on Host host1, Ended: 08Dec2008:10:53:33
    Moved job information to .\SASGSUB-2008-11-21_21.52.57.130_testPgm

  Job 1918 (testPgm) is Finished:  Submitted: 08Dec2008:10:53:33, Started: 08Dec2008:10:53:33 on Host host1, Ended: 08Dec2008:10:53:33
    Moved job information to .\SASGSUB-2008-11-24_13.13.39.167_testPgm

  Job 1919 (testPgm) is Finished:  Submitted: 08Dec2008:10:53:34, Started: 08Dec2008:10:53:34 on Host host1, Ended: 08Dec2008:10:53:34
    Moved job information to .\SASGSUB-2008-11-24_13.16.06.060_testPgm

  Job 1925 (testPgm) is Submitted: Submitted: 08Dec2008:10:53:34

Locating Grid Provider Files

If you are using a grid provider other than Platform Suite for SAS, you might need to specify the location of the grid provider's Java files before you can submit jobs to the grid. You can specify the location by using the -GRIDPLUGINPATH option for the SAS Grid Manager Client Utility, either as a command-line option or in the sasgsub.cfg file.