11-12-2015 08:43 AM
A while ago I shared a trick that SAS Enterprise Guide users can use to show progress of their SAS programs processing in the status area. The trick uses the DOSUBL function, introduced in SAS 9.3.
@jb_biyectivo recently submitted a comment with a clever example that shows a "progress bar" style of update. Here's what it looks like when you run it. Note that it features a "bar" that builds with each iteration, and a percentage complete.
This method of instrumenting your code might be useful only in certain situations, but I do think it's a neat trick that shows how you can make the software do something that the developers didn't quite imagine. Thanks @jb_biyectivo!
Here's the code example you can run. You'll need any recent version of SAS Enterprise Guide, running against SAS 9.3 Maint 2 or later.
proc sort data=sashelp.cars out=sortedcars; by make; run; data _null_; /* NOBS= captures total records to process */ set sortedcars nobs=nobs; by make; if first.make then do; rc = dosubl(cat('SYSECHO "Processing CARS: [', repeat("*",floor(_N_ /NOBS*10)), repeat("_",10-floor(_N_ /NOBS*10)),"] ", put(_N_/NOBS, percent.),' / Total: ', put(NOBS,comma4.),' obs.";')); x=sleep(250,.001); end; run;