jump to navigation

SAS_Pause Macro June 21, 2006

Posted by hamcoder in Software.
add a comment

My current job is as a SAS programmer on the Windows platform. I needed a way to insert break points into SAS code so I developed the SAS_Pause macro. I use the SAS_Pause macro in other macros and between proc steps or data steps. While SAS is paused, I can look at datasets and outputs; but I can't look at macro variables. That why the msg parameter can take macro variables in addition to plain text.

Here's the code…
%Macro SAS_Pause(msg=No Message);

/* Function: Temporarily halt SAS processing so files or logs can be viewed */
/* Where Used: Anyplace you can use a macro */
/* Invocation: %SAS_PAUSE(MSG=your message here); */
/* MSG is optional */
/* MSG supports macro variables, e.g. MSG=&&var&i */

%window SASPause color=pink columns=80 rows=20

#03 @03 'SAS has been paused for debugging'
#05 @03 'Press ENTER to continue.'
#07 @03 "&msg"

%display SASPause Delete;

%mend SAS_Pause;