BookmarkSubscribeRSS Feed
ChrisHemedinger
Community Manager

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;
SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
1 REPLY 1
nancy88wilson
Fluorite | Level 6
This is VERY cool. I do like to see the progress on some of my more complex data steps. Excellent tip!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 6067 views
  • 4 likes
  • 2 in conversation