Working with the SAS Program Node

Overview of the SAS Program Node

You can add a SAS Program node to a Flow tab in an orchestration job to run a SAS program. The SAS program is located on the SAS Workspace Server that you specify in the node.

Inputs and Outputs to the SAS Program Node

The SAS Program node can take the inputs and outputs listed in the following table
Inputs and Outputs to the SAS Program Node
Name
Description
Inputs:
SAS_CODE_REMOTE_FILE
The physical location accessible with the SAS Workspace Server where the SAS program resides
SAS_LIST_STATUS
If equal to TRUE, a fragment of the output is sent as node status on each step boundary.
SAS_LIST_WORKTABLE_XML
When selected, saves the list output of the job. This output can be very large.
SAS_LOG_STATUS
If equal to TRUE a fragment of the log is sent as node status on each step boundary
SAS_LOG_WORKTABLE_XML
When selected, saves the log of the job. This log can be very large.
SAS_SERVER_NAME
The name of the logical pooled or non-pooled branch/component of the SAS Application server
SAS_STEPEVENTS
If equal to TRUE when the node is running, events are fired at each step boundary in the SAS program.
Unique Outputs:
FILE_DATA
The SAS code
SAS_LIST_CONTENTS_XML
The contents of the SAS program listing
SAS_LOG_CONTENTS_XML
The contents of the SAS program log
SAS_RC
The final return code from the SAS job.

Using the SAS Program Node

You can create an orchestration job that uses a SAS Program node in the Flow tab to run SAS code in the context of an orchestration job. For example, you could create a job that runs SAS code. The SAS Program node in the job is configured to retain its log and list output.
This sample orchestration job is shown in the following display:
SAS Program Job Flow
SAS Program Job Flow
The reference settings for the SAS Program node are shown in the following display:
SAS Program Reference Settings
SAS Program Reference Settings
Select the server that executes the SAS code that you need to run. These servers must be registered in SAS Management Console. Then navigate to the file on the selected server. The file in this job is named sascoderetain.sas.
If you select a non-pooled workspace server, then you or the user logged in to the Visual Process Orchestration environment needs a password stored in metadata. You can store the password in SAS Management Console’s User Manager. Also note that you might need to change the SAS Logical Workspace server component to SAS token authentication. In this case, refer to the Options tab step in the procedure covered in the “How to Configure SAS Token Authentication” section in the “Authentication Tasks” chapter in SAS Intelligence Platform: Security Administration Guide.
Note that you can use the Raise events for each step check box to specify that events are fired at each step boundary when the SAS program is running. You can also select the appropriate check box if you need to retain the log or the SAS output for the SAS program. Then, you can download the log or the output in the Run Status view.
The SAS Program node inputs are shown in the following display:
SAS Program Node Inputs
SAS Program Node Inputs
Note that the SASCodeEcho_Input is created. This is a newly created input string. The default value of this input parameter (as well as all input parameters) is passed into the SAS code that is submitted. The SAS code contains a SAS macro with a name that is based on the input name. In this case, it is referenced as &SASCodeEcho_Input. This default value must be resolved in the SAS code macro at run time.
The SAS program used in this job is contained in the SASCodeRetainSASOutput.txt file. The file contains the following code:
data _null_; 
   set sashelp.class; 
      attrib Name length = $8; 
      attrib Sex length = $1; 
      attrib Age length = 8; 
      attrib Height length = 8; 
      attrib Weight length = 8; 
      quote='"';
      file "&SASCodeEcho_Input" dlm=' ';
      
         put 
            quote +(-1) Name +(-1) quote
            quote +(-1) Sex +(-1) quote
            quote +(-1) Age +(-1) quote
            quote +(-1) Height +(-1) quote
            quote +(-1) Weight +(-1) quote
            ;

run;
The outputs for the SAS Program node are shown in the following display:
SAS Program Node Outputs
SAS Program Node Outputs
Note that the unique outputs for SAS Program include XML output of the list and log contents of the node and a completion status indicator.