STP Procedure

PROC STP Statement

Executes a stored process

Syntax

Required Argument

PROGRAM=“metadata-path-of-stored-process”
specifies the metadata location of the stored process to be executed.

Optional Argument

ODSOUT=STORE | REPLAY
specifies a destination for ODS output from the stored process. If you specify STORE, then the ODS output is stored so that it can be used by subsequent SAS statements. If you specify REPLAY, then the ODS output is displayed in the Output window of the SAS windowing environment.

Examples

Example 1

The following example executes the Hello World stored process and generates an HTML file that is saved in a local directory:
PROC STP PROGRAM="/Products/SAS Intelligence Platform/Samples/
      Sample: Hello World";
   OUTPUTFILE _WEBOUT="./hello.html";
   RUN;

Example 2

The following example executes the Hello World stored process and displays the output:
PROC STP PROGRAM="/Products/SAS Intelligence Platform/Samples/
      Sample: Hello World" ODSOUT=REPLAY;
   RUN;

Example 3

The following example executes the Hello World stored process and saves the output:
PROC STP PROGRAM="/Products/SAS Intelligence Platform/Samples/
      Sample: Hello World" ODSOUT=STORE;
   RUN;

Example 4

The following example executes a stored process that produces a graph and table, and then replays the output:
proc stp program="/ProcSTP/odstest" odsout=store;
run;

%STPBEGIN;
proc document name=&_ODSDOC (read);
   replay / levels=all;
run;
quit;
%STPEND;
The following code shows the odstest.sas. stored process:
%STPBEGIN;
   proc gchart data=sashelp.class; 
      vbar age / discrete; 
   run; quit;

   proc print data=sashelp.class;
   run; quit;
%STPEND;

Example 5

The following example executes two stored processes and replays both documents:
proc stp program="/ProcSTP/procprint" odsout=store;
run;
%let printdoc=&_ODSDOC;

proc stp program="/ProcSTP/gchart" odsout=store;
run;
%let graphdoc=&_ODSDOC;


%STPBEGIN;
proc document name=&graphdoc (read);
   replay / levels=all;
run;
quit;

proc document name=&printdoc (read);
   replay / levels=all;
run;
quit;
%STPEND;
The following code shows the gchart.sas stored process:
%STPBEGIN;
   proc gchart data=sashelp.class; 
      vbar age / discrete; 
   run; quit;
%STPEND;
The following code shows the procprint.sas stored process:
%STPBEGIN;
proc print data=sashelp.class;
   run; quit;
%STPEND;