BookmarkSubscribeRSS Feed
BrahmanandaRao
Lapis Lazuli | Level 10
in work library  i assigned below macro variables i want assigned macro variables count in session

%let a=Alfred; %let b=William; %let c=Philp;

how to get macro variables count in a library

6 REPLIES 6
Tom
Super User Tom
Super User

I don't understand what the question is.

BrahmanandaRao
Lapis Lazuli | Level 10

how can we get macro variables count in a library 

for example i assigned three macro variables in a work library 

PaigeMiller
Diamond | Level 26

@BrahmanandaRao wrote:

how can we get macro variables count in a library 

for example i assigned three macro variables in a work library 


Please explain further. Macro variables are not associated with a library.

--
Paige Miller
BrahmanandaRao
Lapis Lazuli | Level 10
I assigned macro a b c using let
Reeza
Super User
Macro variables are per session so you can query the sashelp vmacro table for all user created macros in a session similar to other dictionary tables.
Tom
Super User Tom
Super User

Macro variables are not related to librefs or datasets.

You an query the DICTIONARY.MACROS metadata.

For example to find the number of GLOBAL macro variables you could use this query.

proc sql ;
select count(*) as n_macros
from  dictionary.macros where scope='GLOBAL' and offset=0 
;

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 6 replies
  • 599 views
  • 2 likes
  • 4 in conversation