SAS Enterprise Guide

Desktop productivity for business analysts and programmers
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.

 

undefined

 

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;
Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
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!

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

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
  • 5906 views
  • 4 likes
  • 2 in conversation