Skip to content

MacroCore Library

The MacroCore library provides routines and helpers for use in SAS side application logic and deployments. It is divided into 5 sections:

  • BASE - Macro functions (mf_*) and macro procedures (mp_*) that can be used in all flavours of SAS. No XCMD is assumed.

  • META - Macros (mm_*) that interface with SAS 9 metadata. No XCMD assumed.

  • METAX - Metadata macros that depend on XCMD, eg those interfacing with the Batch tools.

  • VIYA - Macros that interface with SAS Viya. No XCMD assumed.

Check out the source code and documentation.

Installation

The easest way to make these macros available is to just include them in your session as follows:

filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;

If you don't have internet access from your SAS session, you can download the macros directly from here and place them in your autoexec, or initialisation file.

A further option might be to git clone the repository, and set up sasautos, eg:

options insert=(sasautos="/your/path/macrocore/base"));
options insert=(sasautos="/your/path/macrocore/meta"));

The finaly deployment option, if you are building web apps, is Node Package Manager - simply run npm install macrocore in your project repository. Using sasjs-cli you can compile these macros into your web services at build time, and lock them to a particular release.