Desktop productivity for business analysts and programmers

Trick for showing program progress in SAS Enterprise Guide

Reply
Community Manager
Posts: 2,691

Trick for showing program progress in SAS Enterprise Guide

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.

 

progress.gif

 

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;
Occasional Contributor
Posts: 17

Re: Trick for showing program progress in SAS Enterprise Guide

This is VERY cool. I do like to see the progress on some of my more complex data steps. Excellent tip!
Ask a Question
Discussion stats
  • 1 reply
  • 535 views
  • 4 likes
  • 2 in conversation