In reply to Leonid Batkhan.

Thanks, it makes sense as far as it goes, but I don't use the DATA step much. I always write global statements outside PROCs and the DATA step to make it clear. Most of these take effect when the RUN statement executes, but some appear to have an effect before that, maybe where run-group processing is used, e.g. in PROC SQL and PROC GLM. Some others, such as ODS PAGE=, take effect immediately. I have been using SAS for a long time and it is still not clear to me.

Some kind of consistent terminology and documentation of all this would help. For example, documentation for PROC SQL shows the QUIT statement but PROC GLM does not. Why not show RUN and QUIT always in the documentation for PROCs? Try searching for these and you find nothing really useful. It is all very frustrating. Label all statements with "immediate" or "next run" or both. For the DATA step use "declaration" or "executable" or both (e.g. for retain).