STP Procedure

INPUTDATA Statement

Defines input data files for the execution of the stored process

Syntax

Required Argument

stored-process-data-file
specifies the name of an input data file that is defined by the stored process metadata. This name corresponds to an input parameter (macro variable) that is visible to the stored process program. Specify the name of the input data file in one of the following ways:
member-name specify a one- or two-level name of a SAS data set or view. The stored process accesses the data file directly through a temporary libref.
“data-set-path” provide alternate syntax for specifying a local data set. As with the member-name syntax, the stored process accesses the data file directly through a temporary libref.

Details

The INPUTDATA statement passes a data file that is known within the PROC STP environment to the stored process environment. The stored process must be defined to use input data files in metadata before the INPUTDATA statement can be used. Multiple INPUTDATA statements can be specified in a single procedure call. PROC STP prepends the INPUTDATA label with _SOURCE_, in order to be compliant with how data sources are handled in SAS Management Console.

Examples

Example 1

The following example passes the data set via a data set path in the local file system:
PROC STP PROGRAM="/User/johndoe/procstp/append";
   inputdata data1='\\tstgen\wky\tst-v930\procstp\testwdat\dnt\emps.sas7bdat';
run;

Example 2

The following example passes the data set via a two-level name:
libname dataemps '\\tstgen\wky\tst-v930\procstp\testwdat\dnt\ ';
 
PROC STP PROGRAM="/User/johndoe/procstp/append";
   inputdata data1=dataemps.emps;
run;

Example 3

The following example passes the data set via a one-level name. The data set resides in the WORK library.
PROC STP PROGRAM="/User/johndoe/procstp/append";
   inputdata data1=emps;
run;
In all of these examples, the stored process appends two new observations to the input data set that is passed in by PROC STP. The following SAS code supports the append stored process. Notice that in all of these examples, PROC STP modifies data1 to be _SOURCE_data1. Within this stored process, PROC APPEND uses the _SOURCE_data1 reference that is passed in by PROC STP:
/* Create a local data set with 2 employee observations */
data work.newemps; 
   length First_Name $8 Last_Name $9 Job_Title $8;
   input First_Name $ Last_Name $
      Job_Title $ Salary;
   datalines;
Joshua Alexander Auditor 41423
Gabriel Ryan Trainee 26018
;
run; 
 
/* Call PROC APPEND to append the local data set to 
   the dataset passed by PROC STP */
proc append base=&_SOURCE_data1 data=work.newemps;
run;