BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
fengyuwuzu
Pyrite | Level 9

I use SAS 9.4 under Linux, and use the following code :

libname Anawager "/HPCTMP_NOBKUP/home/data/analysis_wager";
libname test "/HPCTMP_NOBKUP/home/data/analysis_wager/test_04072016";

proc sql;
create table test.wager_per_day_all as
select DUPI, datepart(wagerdatetime) as date format =date9.,
sum(total_wager) as wager_per_day
from test.dupi_wager_b_all
group by DUPI, date;
quit;

but got the error:

 

3
4
5
6
7          proc sql;
8          create table test.wager_per_day_all as
9          select DUPI, datepart(wagerdatetime) as date format =date9.,
10         sum(total_wager) as wager_per_day
11         from test.dupi_wager_b_all
^L2                                                          The SAS System                                15:47 Friday, April 8, 2016

12         group by DUPI, date;
ERROR: Sort execution failure.

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
13         quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: SAS set option OBS=0 and will continue to check statements. This might cause NOTE: No observations in data set.
NOTE: PROCEDURE SQL used (Total process time):
      real time           1:28.87
      cpu time            1:32.04

14


ERROR: Errors printed on page 2.

NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           1:29.00
      cpu time            1:32.09

 

can anyone give some hints about this error? Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Have you checked the hints in Usage Note 39705: Troubleshooting Sort Initialization and Sort Execution Failure errors in SQL proce...?

 

The note states:

 

Sort Initialization and Sort Execution errors might occur in an SQL procedure for several reasons. The errors are typically caused by a lack of disk space or memory or a less-than-optimal system option setting.

 

And the note offers several methods for checking available disk space and working around the constraints.

View solution in original post

4 REPLIES 4
ballardw
Super User

Since the variable DATE doesn't exist until writing the result I would try;

 

group by DUPI, datepart(wagerdatetime);

fengyuwuzu
Pyrite | Level 9

Thank you. I changed the date as datepart(wagerdatetime) but still got the same error.

previsouly I tested this code in Windows SAS 9.4 and it worked.

 

maybe some other reasons.

FreelanceReinh
Jade | Level 19

Have you checked the hints in Usage Note 39705: Troubleshooting Sort Initialization and Sort Execution Failure errors in SQL proce...?

 

The note states:

 

Sort Initialization and Sort Execution errors might occur in an SQL procedure for several reasons. The errors are typically caused by a lack of disk space or memory or a less-than-optimal system option setting.

 

And the note offers several methods for checking available disk space and working around the constraints.

fengyuwuzu
Pyrite | Level 9

Thank you. Yes, the error is due to limited space for work directory.

I changed the work directory and it ran okay.

 

Thanks!

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 140724 views
  • 3 likes
  • 3 in conversation