O'Reilly logo

SAS Macro Language Magic by Robert Virgile

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required