Easy Inserting/Appending Libraries into FMTSEARCH path lists in SAS 9.2
In SAS 9.1.3 and prior, Options list (such as FMTSEARCH for libraries with format catalogs, and SASAUTOS for paths that contain macros shared across jobs) were annoying to work with. If you have nested code that wants to add a library or a path the list, doing so like this could potentially clobber statements executed outside of the nested block:
OPTIONS FMTSEARCH=(mylib.formats);
To really be safe, you want to add your library to the list. Doing this wasn't very intuitive. I had always done this like this:
%let FMTSEARCH = %substr(%sysfunc(getoption(fmtsearch) ) ,2); OPTIONS FMTSEARCH = (mylib.formats &FMTSEARCH;
But in 9.2, there are two new System Options, INSERT= and APPEND=. This is now as simple as
OPTIONS INSERT=(FMTSEARCH=mylib.formats);