Selective SAS Option Restoration with PROC COMPARE and PROC OPTLOAD
September 24, 2025: 1:30 PM - 2:00 PM
Foundational Coding Skills (FCS), Breakout Room #8

Authors Abstract
John King Abstract Managing system options in SAS macros is often error-prone, especially when global settings are altered temporarily. This paper presents a macro %u_optstore that allows for the safe saving and selective restoration of only the SAS options that have changed. By combining PROC OPTSAVE, PROC COMPARE, and PROC OPTLOAD, this approach minimizes risk, supports nested macros, and provides debugging transparency. It also avoids known issues associated with full option reloads, such as unwanted resets to session defaults.