SAS
Not yet tested on a real installation — tell us how it went. The code follows the vendor's documentation. Write to support@taskbeacon.io.
Uses PROC HTTP.
The code
This is the code the Code tab generates (with start, errors and rows ticked). In the app it already contains your job's own address.
/* --- TaskBeacon: top of the program --- */
%let tb = https://taskbeacon.io/ping/your-job-id;
filename tb_out temp;
%macro tb_ping(path);
proc http url="&tb.&path" method="GET" out=tb_out timeout=10; run;
%mend;
%tb_ping(%str(/start));
/* --- your code here --- */
data work.result; set sashelp.class; run;
/* --- TaskBeacon: end of the program --- */
%macro tb_end;
/* SYSCC: 0 = fine, 4 = only warnings, above 4 = errors */
%if &syscc > 4 %then %do;
/* after an error, batch SAS checks only the syntax (OBS=0) and skips steps: leave that mode so the ping runs */
options nosyntaxcheck obs=max replace;
%tb_ping(%str(/fail?rc=&syscc));
%end;
%else %do;
proc sql noprint; select count(*) into :tb_rows trimmed from work.result; quit;
%tb_ping(%str(?rows=&tb_rows));
%end;
%mend;
%tb_end;How it works
The code pings /start when the script begins, the plain address with the row count when it ends well, and /fail when it fails (SYSCC above 4), with SYSCC as the return code.
Untick options on the Code tab to leave parts out. See what can be reported.
Run a SAS program on a schedule
SAS for Windows runs a program in batch with -sysin; the log and listing go next to the program unless you say otherwise. Use the path of your installation:
"C:\Program Files\SASHome\SASFoundation\9.4\sas.exe" -sysin "C:\jobs\sales.sas" -log "C:\jobs\logs" -nosplash -icon
Put that line in Task Scheduler (Action: Start a program) or in a .bat file that the task starts. On a SAS server, your administrator may use a scheduler of their own; the pings work the same way.
Why the exit code isn't enough
SAS 9.4 for Windows returns a code to Windows when it ends: 0 when all steps ended normally, 1 with warnings, 2 with errors (SAS 9.4 Companion for Windows, undated, read 2026-11).
A .bat wrapper that runs other commands after SAS can hide that code, and a program that finishes with 0 can still produce an empty table.
The code above checks &syscc at the end: above 4 means an error, and it sends /fail?rc= instead of the row count.
After an error, SAS in batch switches to syntax check mode: it sets OBS=0 and skips the remaining steps, so PROC HTTP would not run either. The failure branch therefore first runs options nosyntaxcheck obs=max replace; to leave that mode, then sends the ping (SYNTAXCHECK system option, SAS 9.4 and Viya, updated 2026).
Report the row count
The end of the program counts the rows of work.result with PROC SQL. Replace it with the table your program produces, for example mylib.sales_daily.
Common problems
- PROC HTTP can't connect. Check that the SAS session may reach the internet; a company proxy is set with the
PROXYHOST=option of PROC HTTP. - No finish ping after an error. With
OPTIONS ERRORABENDor an%ABORTSAS stops before the last lines run; the job then shows as Late. Remove the option, or move the end block into a step that always runs. - Network drives. A task that runs while you are logged out doesn't see mapped drive letters; use UNC paths in
LIBNAMEandFILENAME.
Use cases: Get an alert when a SAS batch job ends with errors. More questions: FAQ.