BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Nietzsche
Lapis Lazuli | Level 10

Hello.

Is there a quick way to view the Global or Local Symbol Table(s)? I wish to see my current macro variables.

 

Thank you in advance.

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Look at SASHELP.VMACRO

--
Paige Miller

View solution in original post

9 REPLIES 9
PaigeMiller
Diamond | Level 26

Look at SASHELP.VMACRO

--
Paige Miller
yabwon
Amethyst | Level 16

... or by SQL:

proc sql;
  select * from dictionary.macros;
run;

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



s_lassen
Meteorite | Level 14

You just submit

%put _user_;

to see the macro variables that you yourself have created, and

%put _automatic_;

To see the system generated macro variables.

Inside a macro you can use

%put _local_;

to see locally defined macros, and 

%put _global_;

to see globally defined macro variables.

 

yabwon
Amethyst | Level 16

... and:

%put _all_;

to see everything.

 

Bart

_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



Nietzsche
Lapis Lazuli | Level 10

I tried

%put _all_;  and
%put _local_;

My local variables symbol tables are not being displayed. 

Does the %put _all_; and %put _local_; have to be inside the macro definition for it to be displayed in the log?

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).
s_lassen
Meteorite | Level 14

Yes, local variables only exist inside the macro, so you have to put it inside the macro definition.

Nietzsche
Lapis Lazuli | Level 10

thank you

SAS Base Programming (2022 Dec), Preparing for SAS Advanced Programming (Cancelled).

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
  • 9 replies
  • 4303 views
  • 16 likes
  • 4 in conversation