When SAS executes the stored program, it resolves the intermediate code produced by
the compiler and generates the executable machine code for that operating environment.
The following figure shows the process for executing a stored compiled DATA step
Figure 28.2 Executing a Stored Compiled Program
To move, copy, rename, or delete stored programs, use the DATASETS procedure or the
utility windows in your windowing environment.
Creating a Stored Compiled DATA Step Program
Syntax for Creating a Stored Compiled DATA Step Program
The syntax for creating a stored compiled DATA step program is as follows:
DATA data-set-name(s) / PGM=stored-program-name
specifies a valid SAS name for the output data set created by the source program.
The name can be a one-level name or a two-level name. You can specify more than
one data set name in the DATA statement.
specifies a valid SAS name for the SAS file containing the stored program. The
name can be a one-level name, but it is usually a two-level name. Stored programs
are assigned the member type PROGRAM in the SAS library.
assigns a password to a stored compiled DATA step program.
enables you to save or encrypt the source code.
For complete information about the DATA statement, see SAS Statements: Reference.
Process to Compile and Store a DATA Step Program
To compile and store a DATA step program, do the following:
1. Write, test, and debug the DATA step program that you want to store.
If you are reading external raw data files or if you write raw data to an external file,
use a fileref rather than the actual filename in your INFILE and FILE statements so
that you can redirect your input and output when the stored program executes.
2. When the program runs correctly, submit it using the PGM= option in the DATA
Creating a Stored Compiled DATA Step Program 681