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.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
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 (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info 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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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