Hi, all. Each time I start SAS, it takes about a few minutes to initiate and it takes so long to even print a very small dataset (sometimes even 1 rows). This is the log that I just had:
3 proc print data=hw5.flowers;run; NOTE: Writing HTML Body file: sashtml.htm NOTE: There were 150 observations read from the data set HW5.FLOWERS. NOTE: PROCEDURE PRINT used (Total process time): real time 3:33.29 cpu time 0.62 seconds
Real time is much longer than cpu time. But if I print it again, it takes no time:
NOTE: There were 150 observations read from the data set HW5.FLOWERS. NOTE: PROCEDURE PRINT used (Total process time): real time 0.01 seconds cpu time 0.01 seconds
Why is that? Is it because the Writing HTML Body file issue? How do I deal with that then?
Problem solved!
It's actually caused by a printer of my school, which is set by windows as default and is disconnected at home. It seems that SAS will check for printers while initializing so it also explains my another question on being stuck for using ods.
I found the solution here
Look at the library definition for library HW5. I suspect it points to something remote, either with a very slow network connection or badly misconfigured. After the first run, the data is read from your local cache.
Sorry but when I tried to copy and paste this folder to a local directory, the same thing happened, just for this proc varclus process:
342 libname hw5 "D:\hw5"; NOTE: Libref HW5 was successfully assigned as follows: Engine: V9 Physical Name: D:\hw5 343 344 proc print data=hw5.flowers;run; NOTE: There were 150 observations read from the data set HW5.FLOWERS. NOTE: PROCEDURE PRINT used (Total process time): real time 0.05 seconds cpu time 0.03 seconds 345 346 proc varclus data=hw5.flowers proportion=.9 outtree=hw5.tree1; 347 var sl sw pl pw; 348 run; NOTE: Clustering algorithm converged. NOTE: Clustering algorithm converged. NOTE: The data set HW5.TREE1 has 6 observations and 8 variables. NOTE: PROCEDURE VARCLUS used (Total process time): real time 3:30.86 cpu time 0.65 seconds
Real time is 3 min 30 sec, but the cpu time is only 0.65 seconds
Do you start your SAS software from a network location?
No. I have ensured that all files needed for running sas code are in the local directory.
My SAS is installed in D:\software, my dataset and code is in D:\hw5 and the onedrive is in D:\Onedrive so I assume SAS won't be affected, right?
What directory is your HW5 SAS library pointing to? If it is pointing to your cloud One Drive, that might explain the poor performance. Move the library to a folder that is on your PC hard drive and test your program again. I'm assuming here that D is a local drive on your PC.
Hello @leen
The large difference between real time and cpu time typically indicates an I/O issue.
One possibility is that the D drive is not local to the machine that is running SAS i.e. it may be a remote or networked location.
is your SAS running on your local PC or on the server.
It's:
libname hw5 "D:\hw5";
And i am pretty sure D:/ is a local drive, not a network location. This happens to me today as well, with no exception. But the most important point is that this problem will only happen at first output (I think it's HTML output because:
5 6 proc sql; 7 select * from myora.customer_t where customerstate="NY" or customerstate="PA"; NOTE: Writing HTML Body file: sashtml.htm 8 quit; NOTE: PROCEDURE SQL used (Total process time): real time 3:30.67 cpu time 0.28 seconds 9 proc sql; 10 select * from myora.customer_t where customerstate="NY" or customerstate="PA"; 11 quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.03 seconds cpu time 0.01 seconds
)
If I run below command in a dos command prompt (cmd)...
c:\temp>wmic logicaldisk get deviceid, volumename, description
...I get output like below
Description DeviceID VolumeName Local Fixed Disk C: Windows Network Connection I: Data
If you run the same command on your computer what does it say for your D-drive?
C:\Users\JselZ>wmic logicaldisk get deviceid, volumename, description Description DeviceID VolumeName Local Fixed Disk C: Acer Local Fixed Disk D: ???
Sure this is the result.
Having a local sas installation and processing locally stored data only, real time should be much lower using recent hardware. Can you post some details about the computer used: cpu, memory, harddisks
Hello @leen
In your first post you have mentioned
"Hi, all. Each time I start SAS, it takes about a few minutes to initiate and it takes so long to even print a very small dataset (sometimes even 1 rows). "
This indicates that either the laptop has insufficient resources OR the D drive is not physically installed in the laptop.
It is customary in corporate environment to mount a networked or shared drive at boot time with a drive letter. This gives the impression that it is a local drive.
It also happens often that a user works on a remote machine/VDI and the desktop is essentially a window to access those resources.
If there is a local IT support group / SAS Admin in your organization do approach them
I do have a network location under this PC. But I used nothing from that location while running my sas code. (It even doesn't contain any information). And when I had that problem, I was at home, connected successfully to that local network drive.
Try this to test your HTML theory:
proc sql noprint;
create table test as
select * from myora.customer_t where customerstate="NY" or customerstate="PA";
quit;
Given you are reading from Oracle, another explanation is database caching.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.
Ready to level-up your skills? Choose your own adventure.