Desktop productivity for business analysts and programmers

run

Accepted Solution Solved
Reply
Contributor
Posts: 25
Accepted Solution

run

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


Accepted Solutions
Solution
‎04-09-2012 05:37 PM
Esteemed Advisor
Posts: 7,300

Re: run

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


All Replies
Solution
‎04-09-2012 05:37 PM
Esteemed Advisor
Posts: 7,300

Re: run

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.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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