jump to navigation

SAS_Pause Macro June 21, 2006

Posted by hamcoder in Software.

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;



No comments yet — be the first.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: