Chapter 8
Interfaces with the Macro Facility
Interfaces with the Macro Facility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
DATA Step Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Interacting with the Macro Facility during DATA Step Execution . . . . . . . . . . . . 104
CALL EXECUTE Routine Timing Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Example of Using CALL EXECUTE Incorrectly . . . . . . . . . . . . . . . . . . . . . . . . . 105
Example of Common Problem with CALL EXECUTE . . . . . . . . . . . . . . . . . . . . . 106
Using SAS Language Functions in the DATA Step and Macro Facility . . . . . . . . 108
Interfaces with the SQL Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Using PROC SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
INTO Clause . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Controlling Job Execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Interfaces with the SAS Component Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Using an SCL Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
How Macro References Are Resolved by SCL . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Referencing Macro Variables in Submit Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Considerations for Sharing Macros between SCL Programs . . . . . . . . . . . . . . . . . 111
Example Using Macros in an SCL Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
SAS/CONNECT Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Overview of SAS/CONNECT Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Using %SYSRPUT with SAS/CONNECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Example Using %SYSRPUT to Check the Value of a Return
Code on a Remote Host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Using %SYSLPUT with SAS/CONNECT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Example Using %SYSLPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Interfaces with the Macro Facility
An interface with the macro facility is not part of the macro processor but rather a SAS
software feature that enables another portion of the SAS language to interact with the
macro facility during execution. For example, a DATA step interface enables you to
access macro variables from the DATA step. Macro facility interfaces are useful because,
in general, macro processing happens before DATA step, SQL, SCL, or SAS/CONNECT
execution. The connection between the macro facility and the rest of SAS is not usually
dynamic. But by using an interface to the macro facility, you can dynamically connect
the macro facility to the rest of SAS.
103
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset