BookmarkSubscribeRSS Feed
Lapis Lazuli | Level 10

Everybody is familiar with SAS global statements, such as

  • FILENAME statementmanaging-global-statements.jpg
  • LIBNAME statement
  • OPTIONS statement
  • TITLE statement
  • FOOTNOTE statement
  • X statement, etc.

They can be used in SAS open code, within SAS macros, as well as within DATA and PROC steps.

Global statements are not executable by definition, meaning they are not executed during individual iterations of the DATA step. However, they do "take effect", that is in essence "execute" at some point in a SAS program. To lift the veil of mystery about SAS global statements' habits I recently wrote a blog post

How to conditionally execute SAS global statements

Take a read and you will never be confused by the global statements' behavior again.

Happy programming,


Tourmaline | Level 20

I would title this thread "How to: Conditionally execute SAS global statements"

to carry the fact that this is not a question.

Lapis Lazuli | Level 10

Hi ChrisNZ,

That is how the blog post is titled. As for the Community "announcement" title, there are two attributes which make it non-question: 1) no "?" at the end, and 2) "can" stands after "you", in a question it would've been in reverse 😀

Tourmaline | Level 20

More emphasis on the demonstration rather than question aspect can only be a good thing imho, but your call obviously, just a suggestion 🙂 

Lapis Lazuli | Level 10

Hi ChrisNZ,

Per your advice, I modified the title to be "Solution: How you can conditionally execute SAS global statements".

Thank you,



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
  • 4 replies
  • 2 in conversation