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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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