BookmarkSubscribeRSS Feed
fri0
Quartz | Level 8

HI, I'm doing a left join using a proc sql but I get this error: ERROR: Sort key definition failure.

This is a query that I've executed before without no problems:

 

proc sql;
create table work.data as select
a.codunicocli,
b.codclavecic,
b.apepatcli,
b.apematcli,
b.nbrcli
from work.febrero as a
left join ods_v.md_cliente as b on a.codunicocli=b.codunicocli;
quit;

Any suggestion to solve it? Thanks!

 

PD. I'm using SAS Enterprise Guide 7.1

4 REPLIES 4
JBailey
Barite | Level 11

Hi @fri0 

 

This error usually occurs when SAS runs out of a resource. I would verify that SAS work has sufficient space.

 

Best wishes,
Jeff

fri0
Quartz | Level 8

I copied the second table to a table in the work library and the query works... This has no sense to me, if the problem would be space, I couldn't make a copy of any table right?

JBailey
Barite | Level 11

Hi @fri0 

 

Join processing can cause an increase in the size of data that is written to work. I am not sure where the space issue actually is, but this type of error is always a "Hey, I can't get enough of something" problem.

 

Best wishes,
Jeff

Patrick
Opal | Level 21

@fri0 

A SQL left join requires implicit sorting of your source tables and though will create temporary utility files which might consume a multiple of the source table disc space. So just being able to copy a source table to WORK doesn't proof that you've got enough space.

System option UTILLOC points often to WORK.

 

To get as much WORK space as possible start a new session or delete tables in WORK before you run your SQL.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 3115 views
  • 0 likes
  • 3 in conversation