BookmarkSubscribeRSS Feed
Antara_Barman
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?.

4 REPLIES 4
Reeza
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.
donricardo
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*/
run;
%let endtime = %sysfunc(time());
Data _null_;
Format ElapsedTime time11.2;
ElapsedTime = &endtime - &begintime;
Put elapsedtime=;
Run;

ballardw
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.

 

 

SASKiwi
PROC Star

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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 4 replies
  • 686 views
  • 0 likes
  • 5 in conversation