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

Finally, the query ends with a QUIT statement. You do not need a
RUN statement because PROC SQL executes as soon as a complete query has been
specified. If you don’t include a QUIT statement, PROC SQL remains in memory for
another query.

Above is from my textbook,  I cannot understand.

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

PROC SQL is "interactive". Each statement is executed immediately when completed, so no RUN; is needed. To end the procedure, a QUIT; is the correct way. But the SAS interpreter will also terminate the SQL procedure if a DATA or PROC statement is encountered.

 

Other procedures that are not ended by a RUN are those that support run-group processing, like PROC DATASETS; these also need a QUIT.

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

PROC SQL should always end with QUIT;

 

It should never end with RUN;

--
Paige Miller
Kurt_Bremser
Super User

PROC SQL is "interactive". Each statement is executed immediately when completed, so no RUN; is needed. To end the procedure, a QUIT; is the correct way. But the SAS interpreter will also terminate the SQL procedure if a DATA or PROC statement is encountered.

 

Other procedures that are not ended by a RUN are those that support run-group processing, like PROC DATASETS; these also need a QUIT.

tianerhu
Pyrite | Level 9
Thank you for your help.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1278 views
  • 0 likes
  • 3 in conversation