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
Onyx | Level 15

... 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
Onyx | Level 15

... 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).
Nietzsche
Lapis Lazuli | Level 10

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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