Using the Windows LOGEVENT.EXE
utility that is provided by the Windows Resource Kit, you can send
your own information messages to the Application Log from within SAS
code.
In the following example,
the existence of a semaphore file is checked before SAS performs some
lengthy processing.
%macro pdata(file);
%local cmdstr;
%let cmdstr = "dir &file";
options noxwait;
DATA _null_;
call system(&cmdstr);
run;
%if &sysrc=0 %then %do;
filename indata "&file";
/* Your data step code for this file. */
DATA a;
infile indata length=linelen;
length line $ 200;
input @1 line $ varying200. linelen;
PROC print;
run;
%end;
%else %do;
/* Log an Event of type Error. */
%let cmdstr = %bquote(c:\support\sasset2\logevent.exe -s E
"The file &file did not exist so no data step ran.");
DATA _null_;
%sysexec &cmdstr;
run;
%end;
%mend;
%pdata(c:\config.syss)
When you double-click
the event in the Application Log, the
Event Properties window will display the message in the
Description box.
Displaying a User Message in The Event Detail Dialog Box
For information about
LOGEVENT.EXE, see the documentation for the Windows Resource Kit.