Common Code Generated for a Job

Overview

When SAS Data Integration Studio generates code for a job, it typically generates the following items:
The generated code includes the user name and password of the person who created the job. You can set options for the code that SAS Data Integration Studio generates for jobs and transformations. For details, see Specifying Options for Jobs.

LIBNAME Statements

When SAS Data Integration Studio generates code for a job, a library is considered local or remote in relation to the SAS Application Server that executes the job. If the library is stored on one of the machines that is specified in the metadata for the SAS Application Server that executes the job, it is local. Otherwise, it is remote.
SAS Data Integration Studio generates the appropriate LIBNAME statements for local and remote libraries.
The following syntax is generated for a local library:
libname libref  <"lib-specification"> <connectionOptions> <libraryOptions>  <schema=databaseSchema> <user=userID> <password=password>;
The following syntax is generated for a remote library:
options comamid=connection_type;
%let remote_session_id=host_name <host_port>;
signon remote_session_id <user=userID password=password>;
rsubmit remote_session_id;
libname libref <engine> <"lib-specification"> <connectionOptions> <libraryOptions> <password=password>;
endrsubmit;

SYSLAST Macro Statements

The Options tab in the property window for most transformations includes a field that is named Create SYSLAST Macro Variable. This field specifies whether SAS Data Integration Studio generates a SYSLAST macro statement at the end of the current transformation. In general, accept the default value of YES for the Create SYSLAST Macro Variable option when the current transformation creates an output table that should be the input of the next transformation in the process flow. Otherwise, select NO.
When you select YES for a transformation, SAS Data Integration Studio adds a SYSLAST macro statement to the end of the code that is generated for the transformation. The syntax of this statement is as follows:
%let
SYSLAST=transformation_output_table_name;
The value represented by
transformation_output_table_name
is the name of the last output table created by the transformation. The SYSLAST macro variable is used to make
transformation_output_table_name
the input for the next step in the process flow. In most cases, this setting is appropriate.
Setting the value to NO is appropriate when you have added a transformation to a process flow if that transformation does not produce output, or if it produces output that should not become the input to the next step in the flow. The following example illustrates a sample process flow.
Process Flow with a Custom Error Handling Transformation
Process Flow with a Custom Error Handling Transformation
In this example, the Custom Error Handing transformation contains user-written code that handles errors from the Extract transformation, and the error-handling code does not produce output that should be become the input to the target table, ALL_MALE_EMP. Instead, the output from the Extract transformation should become the input to ALL_MALE_EMP. The Custom Error Handling transformation was created with the User Written Code transformation. This particular instance of the transformation was renamed to Custom Error Handling.
In this example, you would do the following:
  • Leave the Create SYSLAST Macro Variable option set to YES for the Extract transformation.
  • Set the Create SYSLAST Macro Variable option to NO for the Custom Error Handing transformation.

Remote Connection Statements

Each transformation within a job can specify its own execution host. When SAS Data Integration Studio generates code for a job, a host is considered local or remote in relation to the SAS Application Server that executes the job. If the host is one of the machines that is specified in the metadata for the SAS Application Server that executes the job, it is local. Otherwise, it is remote.
A remote connection statement is generated if a remote machine has been specified as the execution host for a transformation within a job, as shown in the following sample statement:
options comamid=connection_type; 
%let remote_session_id=host_name <HOST_PORT>;
SIGNON remote_session_id <USER=userID password=password>;rsubmit
remote_session_id; 
  ... SAS code ... 
endrsubmit; 

Macro Variables for Status Handling

When SAS Data Integration Studio generates the code for a job, the code includes a number of macro variables that can be used to monitor the status of jobs. For details, see About Status Handling for Jobs and Transformations.

User Credentials in Generated Code

The code that is generated for a job contains the credentials of the user who created the job. If a user's credentials are changed and a deployed job contains outdated user credentials, the deployed job fails to execute. The solution is to redeploy the job with the appropriate credentials. For details, see About Deploying Jobs for Scheduling.