BookmarkSubscribeRSS Feed
gsreddy
Fluorite | Level 6

How to create a macro variables globally as it should be accessible by ateam of 10-20 members?

2 REPLIES 2
Quentin
Super User

Global macro variables exist within a SAS session. They cannot be shared across SAS sessions.

 

That said, if you have a team and you want every team member to have a group of standard global macro variables (&OurTeam, &OurBoss, &Project, etc.) there are lots of options, most of which would involve sharing code and/or data among the team members.   

 

For example, if you have a shared autoexec, you could define the macro variables there.   To get more meaningful help, I would suggest you describe a bit more about your environment (server SAS, PC SAS, Enterprise Guide, Studio, ....?)  and also what approaches you might have considered/tried already.

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Astounding
PROC Star
It might be feasible to store the information as a permanent SAS data set instead of macro variables. In the simplest scenario you would need two variables:

NAME = name of a shared macro variable
VALUE = value of that variable

Then each user could easily reconstruct all the macro variables:

data _null_;
set perm.maclist;
call symputx(name, value) ;
run;

Two issues to consider:

Do users need to update the list of macro variables? This will create contention for the data set.

What length should be used for VALUE? It needs to be long enough to hold your longest macro variable.

Note that it would be possible to make the DATA _NULL_ step part of an auto autoexec file.

sas-innovate-2024.png

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
  • 2 replies
  • 340 views
  • 1 like
  • 3 in conversation