BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
carterson2
Calcite | Level 5

I dont understand when to sprinkle in the "run" command.

Sometimes in EG, %put &s1 yields

&s1

and sometimes in SunOS, the same statement yields correctly as:

1234.5678

But if I remember to magically sprinkle in

run;

%put &s1;

it works. yipee

Q: What is the rule of thumb, and please don't say always insert "run" because I know often times it is unneeded.

thanks

jim

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

To quote from a paper (http://www2.sas.com/proceedings/sugi22/ADVTUTOR/PAPER44.PDF 😞

When a step boundary (basically a RUN statement or

a new step) is encountered, the previous step is

compiled and executed (if no syntax errors were

found ).

In short, if you have to use a macro variable or anything else that is dependent upon compilation and execution (from a data step), use a run statement.

Personally, I like to use them all of the time.

View solution in original post

1 REPLY 1
art297
Opal | Level 21

To quote from a paper (http://www2.sas.com/proceedings/sugi22/ADVTUTOR/PAPER44.PDF 😞

When a step boundary (basically a RUN statement or

a new step) is encountered, the previous step is

compiled and executed (if no syntax errors were

found ).

In short, if you have to use a macro variable or anything else that is dependent upon compilation and execution (from a data step), use a run statement.

Personally, I like to use them all of the time.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1126 views
  • 0 likes
  • 2 in conversation