SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
mariko5797
Pyrite | Level 9

I keep getting an error when trying to sort this dataset (see below). To my understanding from a quick Google search, it means I ran out of space in SAS Work library. However, in my case it is just this function here. The dataset itself was created just fine; it just doesn't like me sorting it. Furthermore, I have no issue running any of the other datasets that proceed this one. Any ideas on possible solutions? I did try to restart SAS.

 

754  data req7;
755      merge req6(in=a) zsa_an2;
756      by patid formname pernum;
757      if a;
758      if formname="CMD" and visno="" then visno=substr(TRIGREC,20,3);
759      if formname="CMD" and visno="" then visno=visno2;
760      if formname="ILL" and visno="" then visno=substr(TRIGREC,20,3);
761      if formname="CS1" and visno="" then visno="01";
762      if formname="MHD" and visno="" then visno="01";
763      if formname="VIA" and visno="" then visno="01";
764  run;

NOTE: There were 151 observations read from the data set WORK.REQ6.
NOTE: There were 21 observations read from the data set WORK.ZSA_AN2.
NOTE: The data set WORK.REQ7 has 151 observations and 42 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.04 seconds


765  proc sort data=req5; by patid formname dosenum; run;

NOTE: There were 20573 observations read from the data set WORK.REQ5.
ERROR: Insufficient space in file WORK.REQ5.DATA.
ERROR: File WORK.REQ5.DATA is damaged. I/O processing did not complete.
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.REQ5 may be incomplete.  When this step was stopped there were 12284 observations and 42 variables.
WARNING: Data set WORK.REQ5 was not replaced because this step was stopped.
NOTE: PROCEDURE SORT used (Total process time):
      real time           2.34 seconds
      cpu time            0.81 seconds

 

4 REPLIES 4
SASKiwi
PROC Star

Are you using SAS on your PC or a remote SAS server? If it is on your PC check your hard drive for free disk space. Where does your dataset REQ5 get created? It isn't included in the partial SAS log you posted. Try PROC SORT with a different output dataset.  

ballardw
Super User

You don't say how big the data set is. Proc SORT in effect needs 3 times size the size of the data set for temporary space to sort.

You can try adding the TAGSORT option to Proc Sort statement to reduce the data used in the temporary files.

 

Or remove stuff from your WORK library that you don't actually need to make room for the Sort.

Ksharp
Super User

You can change WORK library path name by modify sasv9.cfg ,adding option  " -work  'c:\temp'   "  in it .

 

or you could use batch mode to run your sas code like :

-sysin 'c:\temp\sascode.sas'  -log '......'  -work 'c:\temp'  -memsize 0 

Kurt_Bremser
Super User

You run out of space whole sorting a fairly small dataset.

2.34 seconds real time for 0.81 seconds CPU time means your storage can't keep up with your CPU speed.

You need to free space in your WORK location. How you can do this depends on the type of your SAS installation. Do you use a fully local (everything on your PC) setup, or do you use SAS in a server-based environment, either through Enterprise Guide or SAS Studio?

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 7238 views
  • 4 likes
  • 5 in conversation