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;
It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.
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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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