Hi All,
I am getting error in a particular proc sql step where "örder by " "is used, but I am getting sort execution error where order by is used
I got few other alternatives to sort but all of these taking same execution time
Three Alternatives To PROC SORT In SAS - SASnrd
Can anyone tell which one is best to use of "ERROR: Sort execution failure" error .
Thank you!!
So the final sort seems to overflow your WORK, which also explains the failure of your SQL.
Also post your code and log, so we can see what really happens. Post the complete log(all code and messages).
Don't do too much in a single PROC SQL step; if removing the ORDER BY clause fixes your ERROR, add a follow-up PROC SORT step to get the required order.
So the final sort seems to overflow your WORK, which also explains the failure of your SQL.
Also post your code and log, so we can see what really happens. Post the complete log(all code and messages).
This I/O error message normally occurs if you run out of available disk space.
Both Proc Sort and a SQL Order By use UTILLOC - which often is the same location as WORK.
WORK and UTILLOC are both locations on disk under paths created by SAS for the duration of a SAS Session.
You can free-up disk space by deleting tables in WORK that you don't need anymore.
If you're running things on a local SAS installation on your laptop then you might just need to clean-up so you've got more free disk space.
If you're running SAS on a server then normally there is sufficient disk space available for WORK unless it's an undersized environment. If running on a server then I'd also verify that your SQL is doing what it should and that you are not having some many:many Cartesian join that creates a huge data volume.
It would help more if you could provide additional context.
- Where you data originated from
- Size of your data file in GB rather than record count
- Compressed/Uncompressed status
Here is a paper that might of interest to Solving SAS® Performance Problems: Our Methodology
Hope this helps
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.