Grid Enabling SAS Programs
This document outlines how to grid enable a SAS program. It also makes recommendations for when to do so, as well as the advantages.
What is a Grid Enabled SAS Program?
A grid enabled SAS program is a program which has been analysed to run on a SAS Grid platform. When a program is analysed for grid, SAS detects whether the SAS program is suitable for execution across the grid (executing in multiple sessions or jobs).
Once a program is analysed, grid related setup macros and code are inserted into the program. These bits of code include instructions on to split the program, so it gets executed across different SAS sessions within the grid. This program can then be saved and added to the project. When run, a successfully grid enabled program will execute multiple separate processes, distributed across the grid simultaneously (multi-threading). This has the advantage of reducing the overall run time.
When is it Appropriate to Grid Enable a SAS Program?
SAS programs that contain numerous steps and execute over a long duration are likely to benefit the most from Grid Enabling SAS jobs. This is likely to be when:
- When data are read from more than one input table with multiple steps;
- When data are written to multiple output tables with multiple steps;
- When macro language is used to generate multiple steps.
The SAS program should be “stable”, i.e. you rarely modify the contents of the program, or are happy to repeat the Grid enabling steps each time the program is modified
Steps to Grid Enable a SAS Program
SAS Enterprise Guide allows SAS Programs to be analysed for Grid Computing. The steps we should perform is as follows:
- Finalise the user written code;
- When finalised and tested, select “Analyze Program” and then “Analyze for Grid Computing” as shown below:
This will launch the “Analyze SAS Program for Grid Computing” window as shown below:
- Select the “Grid” radio button
- Press the “Begin analysis” button. This may request our program is executed!
- Enter a new name for the Grid Enabled copy of our original program; for example suffix _Grid onto the name.
- Press “Add to project” (this will be enabled after begin analysis) and then finish by pressing "Close".
- This will leave the Process flow with the original and the Grid enabled copies of our programs; similarly to the following:
As can be seen, the grid analyser inserts additional statements and comments into our program which, if suitable, enables SAS to run the program across the grid platform.
It is recommended that a copy of the original program is retained.