Deploying Jobs as Stored Processes

Problem

You want to make a job available to any application that can execute a SAS stored process.

Solution

Deploy the job as a stored process. You can deploy an existing job as a version 1.0 or version 2.0 stored process. For more information about the differences between the versions, see Working with Stored Processes.
Note that when you deploy a job as a stored process, the generated code for the stored process always begins with these lines:
*ProcessBody;
%stpbegin;
If you want to specify code that should come before these two lines when a job is deployed as a stored process, then set the Stored process pre-process code option for the job. To access this option, display the properties window for the job and select Optionsthen selectGeneral section. Specify the desired code in the Stored process pre-process code option.

Tasks

Deploy a Job as a Version 1.0 Stored Process

You might want to deploy a job as a version 1.0 stored process in order to run it on an older server (a server with a version prior to SAS 9.3). Perform the following steps:
  1. In the Inventory tree or the Folders tree on the SAS Data Integration Studio desktop, right-click the job for which you want to generate a stored process. Then, select Stored Processthen selectNew 9.2 from the pop-up menu. The first window of the Stored Process wizard is displayed.
    General Tab
    General Tab
  2. In the first window, enter a descriptive name for the stored process metadata. You might want to use a variation of the job name. Enter other information as desired. For details about the fields in this window, select Help. Click Next to access the Execution tab of the wizard.
  3. Specify a SAS server, a source repository, a source filename, any input stream, and any output type (result type) for the new stored process. The following display shows some sample values for this window.
    Execution Tab
    Execution Tab
    Click Next to access the Parameters tab, where you can specify any parameters that you need for the stored process.
  4. Click Next to access the Data tab, where you can specify any data sources and targets that are used by the stored process.
  5. Click Finish. A stored process is generated for the current job and is saved to the source repository. Metadata about the stored process is saved to the metadata server. A metadata object for the stored process is added to the Stored Process folder in the Inventory tree.
After the job has been deployed, it can be executed with any application that can execute a SAS stored process.

Deploy a Job as a Version 2.0 Stored Process

You might want to deploy a job as a version 2.0 stored process in order to run it on a SAS 9.3 server. Perform the following steps:
  1. In the Inventory tree or the Folders tree on the SAS Data Integration Studio desktop, right-click the job for which you want to generate a stored process. Then, select Stored Processthen selectNew 9.3 from the pop-up menu. The first window of the Stored Process wizard is displayed.
  2. In the first window, enter a descriptive name for the stored process metadata. You might want to use a variation of the job name. Enter other information as desired. For details about the fields in this window, select Help. Click Next to access the Execution tab of the wizard.
  3. Specify a SAS server, a source repository, a source filename, any input stream, and any output type (result type) for the new stored process. For more information about the additional servers available for version 2 stored processes, see Working with Stored Processes.
  4. Click Next to access the Parameters tab, where you can specify any parameters that you need for the stored process.
  5. Click Next to access the Data screen, where you can specify any data sources and targets that are used by the stored process. For information about data sources and targets, click Help in the Modify Data Source and Modify Data Target windows. To access these windows, select a source or target and click Edit.
  6. Click Finish. A stored process is generated for the current job and is saved to the source repository. Metadata about the stored process is saved to the metadata server. A metadata object for the stored process is added to the Stored Process folder in the Inventory tree.
After the job has been deployed, it can be executed with any application that can execute a SAS stored process.