BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sknguru0
Fluorite | Level 6

Good Morning!

 

I am looking to create a structure within our installation, where we can have standard macros used by various applications and departments on top of sas supplied macros. I did some reading and not convinced with the "compiled macro" and thinking of just creating macros and have developer add it in using SASAUTOS options. I did come across this article https://support.sas.com/resources/papers/proceedings/proceedings/sugi29/047-29.pdf which is good, but I am looking for any recommendation to structure, for example, I want one folder with very common macros that can be used by everyone, and in another level, application specific macros, so, the developers can add these libraries in search path. 

 

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

SASAUTOS is perfect for this task.  You can add many folders to the searched pathways, depending on which sets of macros you might want to access.

 

The main stumbling block would be name conflicts and version control.  If you have production macros and development macros, what would happen if a macro by the same name appears in both folders.  The answer is simple:  first one found in the search path is used.  But that may cause unintended consequences.  A programmer who accesses both production and development macros may be unaware of a new addition to one of the folders that would cause him to be using a version of the macro that he doesn't intend to use.  You might want to set up a formal process that encompasses moving a macro from development to production:

 

  • email notification that the change is going to take place, and a date of change, and asking if this will cause any problems
  • make the change during non-peak hours
  • when replacing a macro in the production folder, also copy the old version to a historical folder just in case (a few possible scenarios exist where you may need access to the historical version)
  • remove the code from the development folder
  • email notification that the change has taken place

There's more to think about.  Should a developer always choose an unused name, even when modifying an existing macro?  But this will start you in the right direction (IMO).

View solution in original post

2 REPLIES 2
Astounding
PROC Star

SASAUTOS is perfect for this task.  You can add many folders to the searched pathways, depending on which sets of macros you might want to access.

 

The main stumbling block would be name conflicts and version control.  If you have production macros and development macros, what would happen if a macro by the same name appears in both folders.  The answer is simple:  first one found in the search path is used.  But that may cause unintended consequences.  A programmer who accesses both production and development macros may be unaware of a new addition to one of the folders that would cause him to be using a version of the macro that he doesn't intend to use.  You might want to set up a formal process that encompasses moving a macro from development to production:

 

  • email notification that the change is going to take place, and a date of change, and asking if this will cause any problems
  • make the change during non-peak hours
  • when replacing a macro in the production folder, also copy the old version to a historical folder just in case (a few possible scenarios exist where you may need access to the historical version)
  • remove the code from the development folder
  • email notification that the change has taken place

There's more to think about.  Should a developer always choose an unused name, even when modifying an existing macro?  But this will start you in the right direction (IMO).

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 474 views
  • 0 likes
  • 2 in conversation