Chapter 30
Stored Compiled DATA Step
Programs
Definition of a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . . . . . . . . 685
Uses for Stored Compiled DATA Step Programs . . . . . . . . . . . . . . . . . . . . . . . . . . 686
Restrictions and Requirements for Stored Compiled DATA Step Programs . . . . 686
How SAS Processes Stored Compiled DATA Step Programs . . . . . . . . . . . . . . . . . 686
Creating a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . . . . . . . . . . . 687
Syntax for Creating a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . . 687
Process to Compile and Store a DATA Step Program . . . . . . . . . . . . . . . . . . . . . . 687
Example: Creating a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . . . 688
Executing a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . . . . . . . . . . 689
Syntax for Executing a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . 689
Process to Execute a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . . . 690
Using Global Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
Redirecting Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
Printing the Source Code of a Stored Compiled DATA Step Program . . . . . . . . . 691
Example: Executing a Stored Compiled DATA Step Program . . . . . . . . . . . . . . . . 691
Differences between Stored Compiled DATA Step Programs
and DATA Step Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
Example of DATA Step Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
Quality Control Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
Definition of a Stored Compiled DATA Step
Program
A stored compiled DATA step program is a SAS file that contains a DATA step program
that has been compiled and then stored in a SAS library. You can execute stored
compiled programs as needed, without having to recompile them. Stored compiled
DATA step programs are of member type PROGRAM.
Note: Stored compiled programs are available for DATA step applications only. Your
stored programs can contain all SAS language elements except global statements. If
you do include global statements in your source program, SAS stores the compiled
program. However, SAS does not store the global statements, and it does not display
a warning message in the SAS log.
685

Get SAS 9.4 Language Reference, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.