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.

The Boston Area SAS Users Group is hosting free webinars!
Next up: Joe Madden & Joseph Henry present Putting Power into the Hands of the Programmer with SAS Viya Workbench on Wednesday Nov 6.
Register now at 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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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