BookmarkSubscribeRSS Feed
Calcite | Level 5

Hi, I have a SAS code, it used to run smoothly but now it's taking too much time, sometimes the it's not executing at all. I tried to forcefully close that program. What can I do?. Can anyone suggest me with proper steps?.

Super User
Are you using a company installed SAS version or SAS Academics On Demand?

If a private version you need to talk to your SAS administrators. If On Demand, there's limited support but they usually see these messages.
SAS Employee

I agree that something probably changed.   While this code is not perfect and is a bit crude, if you have a "suspect" part of your code,  you can still used it to estimate clock time for those sections.   Place the code in your existing program, with the "suspect" code between the data _null_ and run statements.   After running, view the Elasped time value in the log. Repeat as needed, but you should restart SAS each time to clear all caches.

/*Here is a program to count elasped time*/
%let begintime = %sysfunc(time());
data _null_;
/*your code here*/
%let endtime = %sysfunc(time());
Data _null_;
Format ElapsedTime time11.2;
ElapsedTime = &endtime - &begintime;
Put elapsedtime=;

Super User

Does the  log show you where steps are taking longer? That there are more observations involved?

Any warnings or notes about data problems in the log?


You may need to describe your environment a bit more. If you are accessing data over a network then you might have bandwidth issues. If pulling data from an external database then you may have performance issues if the providing system is busier than normal.


Also when I see "used to run smoothly" then I also ask "has something changed recently?" Check with your SAS admin or IT. All sorts of things have been known to cause issues.  Like the time my IT department physically moved my network connection to an unconnected cable and it took three days for them to figure out what happened.



Opal | Level 21

Any time a SAS program does not run as expected, the proper first step is to review your SAS log as already mentioned by @ballardw


Search the SAS log for any errors or warnings. If there are then you need to investigate them and fix them. If there are not and it is just a problem of slow performance then find the slowest steps in your program. Are they slower than normal or not? Do your log observation counts look normal or not?


Also remember that if you are using a remote SAS server, your program might be running slower because the server is heavily loaded with other users, and there is no issue with your program. To test this out run your program outside of normal business hours. Does that speed it up a lot? Also talk to your SAS adminisitrators for advice.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 4 replies
  • 5 in conversation