Hi, A bit late to the party, but I have built a system for this at my organisation (built in SAS code), so it is possible to do what you are describing, but was quite a bit of complex work. We have a local Gitlab installation which serves as the single storage repository for a wide range of macros across a number of projects. Users may want to utilise any of these macros in various other projects, so the code ecosystem is very interlinked. These are defined / loaded within a users session using a custom %include type statement in a format like such: %gl_includeCode(GL_PROJECT=project_name, GL_VERSION=Latest); or %gl_includeCode(GL_PROJECT=project_name, GL_VERSION=1.0, GL_FILE=/important_macros/macro_x.sas); And then macros defined in that project can be called/ utilised as normal by the end user, without ever having to create a local copy. The systems allows for fully nested Gitlab references, and also has traceability tools to users can track what is going ok. The underlying code is fairly complex, but relies on the Gitlab API to get a list of all SAS files present, and then individual filename statements for every piece of code to include them. It would definitely be nice if there was a more automated way to do this within SAS. This solutions solves many of the issues we had with a similar structure using standard %includes based on the SAS file system and actually allows for a lot of novel controls which would otherwise be impossible. Every %GL_includeCode call can be logged so we have full visibility of all macro users for a project / file. The use of a custom include function also means we can build in automated nested include tracking / presentation to end users, which would otherwise not be possible. Normal Git versioning is fully accessible, so users can point to a specific version of a repository and never be concerned their referenced macro will change (but will receive log notes with suggestions to move to newer versions) All the collaborative benefits /documentation of GitLab can be leveraged in a single place, by having code live on there as it's sole home. Any code enhancements are forced to be added in the single shared repository, rather than getting lost in specific local repositories.
... View more