Chapter 3: CALL EXECUTE

3.1 Basic Rules

3.2 Achieving the Impossible

3.3 Multiple CALL EXECUTEs

3.4 Finally, the Intricacies

3.4.1 Programming Challenge #2

3.4.2 Solution

3.5 Execute an Experiment

3.6 The Final Intricacy: Macro Variable Resolution

The CALL EXECUTE statement toils in relative obscurity. Despite its power, and despite the fact that it has been available for many years, relatively few programmers are familiar with it. As a result, this section presents some of the basics as well as the intricacies.

3.1 Basic Rules

CALL EXECUTE is a DATA step statement that means: “Run this code.” Here is an overly simple example:

data sales;

     call execute ('proc print data=sales; run;');

     amount=5;

run;

Even though CALL EXECUTE asks for ...

Get SAS Macro Language Magic 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.