BookmarkSubscribeRSS Feed
qwerty12
Fluorite | Level 6

qwerty12_0-1677248224327.pngqwerty12_1-1677248327108.png

can anyone help me out in this

4 REPLIES 4
ChrisHemedinger
Community Manager

What type of library is PHW2022? 

 

Your PROC SORT attempts to sort the data "in place", which means the output of the sort step will replace the table your are sorting. I recommend that you specify an OUT= table instead (if you can) to create a separate sorted table.

 

If your source library is a database (not a SAS data set), then the sort step may not be necessary and certainly isn't the same as a standard SAS data set file.

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
Quentin
Super User

I don't think you can get that error from PROC SORT.

 

Read your log carefully and make sure that your sorted the dataset you intend to sort, and that the BY statement lists the variables in the same order as the BY statement of your data step that reads the data.

 

If you can post the full log showing the PROC SORT step and the step that generates the error, people will be able to help more.

The Boston Area SAS Users Group is hosting free webinars!
Next up: Lisa Mendez & Richann Watson present Get Tipsy with Debugging Tips for SAS® Code: The After Party on Wednesday Jul 16.
Register now at https://www.basug.org/events.
Kurt_Bremser
Super User

PROC SORT cannot cause this ERROR, as its purpose is always to sort an unsorted dataset.

Please post your complete log (all code and messages) from PROC SORT to the occurrence of the ERROR by copy/pasting the log text into a window opened with this button:

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

 

Do NOT post code, logs or data as pictures. ALWAYS post text which we can copy into our SAS environment.

ballardw
Super User

What code did you execute between that sort and the step that caused that error? A very likely cause of this error is a step between the sort and the code you ran that actually generated the error. Or opening the set in a table view and sorting interactively.

 

Please don't show pictures of code or log. Copy the text from the editor or log window, open a text box on the forum using the </> icon and paste the text.

 

If we need to make substantial changes to your code to fix a problem then it is much easier if we can edit text. If we have to retype code the longer it is the more likely you won't get a working solution from pictures.

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 995 views
  • 0 likes
  • 5 in conversation