/******************************************************************** * NAME: notify SYSTEM: PGMR: BLODGETT * * FUNCTION: Send messages to stderr and use sound to notify user * * when steps or jobs complete. * * * * NOTES: * ********************************************************************/ %GLOBAL REVDATE; %LET REVDATE=02JUK98; *<----DATE OF LAST REVISION; %*Update history: 7-2-98: Adding condtional generation of no$syntaxcheck. ; /********************************************************************/ /* BEGIN MACRO DEFINITION */ /********************************************************************/ %MACRO notify (step, /* single positional parm is a number indicating a step#. A msg indicating that that step has completed will be written to stderr and that many beeps will be sounded. If no parm then an end-of-job message will be written and 3 beeps. */ debug=0); /* END */ %if &debug %then %do; %PUT %STR( ); %PUT ***************************************************************; %put * notify macro Rev &revdate begin execution *; %put * Missouri State Census Data Center *; %PUT ***************************************************************; %PUT %STR( ); %end; %let se=&syserr; %*--for consistency with the notify module in sascode we add... ; %if &syserr and &step eq %str() %then %str(options no$syntaxcheck;); data _null_; file stderr; %if &step eq %str() %then %do; put "**** &pgm has completed &sysday &sysdate &systime syserr=&se *****"; file log; put "**** &pgm has completed &sysday &sysdate &systime syserr=&se *****"; call sound(1,1); call sound(1,1); call sound(1,1); call sound(1,1); call sound(1,1); call sound(1,1); run; %end; %else %do; %global pgm; put "&pgm Step &step has completed. syserr= &se "; %do ii=1 %to &step; call sound(1,1); %end; %end; run; %MEND notify;