SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8

sometimes we end some steps with run sometimes with quit, what is the difference? is using run always right so is a better choice?

3 REPLIES 3
PaigeMiller
Diamond | Level 26

There is a difference, there are some situations where you don't need to (or should not) use RUN;

 

for example, PROC SQL ends with a QUIT; and RUN; doesn't have any effect

 

for example, some statistical modeling PROCs can be interactive and perform a task when you use RUN; but do not exit from the PROC until you say QUIT; (so sometimes you use both) Example: PROC GLM

 

In my programming, I have just memorized which PROCs end with RUN; and which don't. Perhaps someone has a more global explanation.

--
Paige Miller
ballardw
Super User

QUIT, other than in Proc SQL, is generally restricted to procedures that use what SAS will refer to as "run group processing" or "interactive". Proc Datasets is a nice example. You can run start the procedure, run a statement or two such as a MODIFY  to rename variables (which ends with a run to execute hence the 'run group') . Then, you can run other statements such as Delete to remove some datasets from the active library, Change to rename some sets and so on. Then when you done manipulating files use Quit to end the procedure. These procedures allow you to see results while keeping something such as a library or dataset in use so they do not require reloading the data.

 

The procedures that use run group processing or interactive are documented for them.

 

Hint: If your session shows a "Proc XXX running" in editor pane margin, then you may be using a procedure that expects a quit.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1082 views
  • 5 likes
  • 4 in conversation