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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 428 views
  • 5 likes
  • 4 in conversation