proc sort data=apple; by colour weight; run;
for proc sort, input data is dataset apple, is the output data set after sorting is also apple?
Hi,
In answer to your question, yes the sorted data set would also be called apple.
If you want to create a new sorted data set and leave the input data set unchanged then the solution posted by @BrahmanandaRao should be fine.
For more information on the proc sort syntax you can see the documentation.
Kind regards,
Amir.
How about reading the documentation at https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/proc/p0ha9ymifyaqldn14m2xlqw252wa.htm
which clearly states
In the following example, the original data set was in alphabetical order by last name. PROC SORT replaces the original data set with a data set that is sorted by employee identification number. The following log shows the results from running this PROC SORT step. Observations Sorted by the Values of One Variable shows the results of the PROC PRINT step. The statements that produce the output follow:
proc sort data=employee;
by idnumber;
run;
proc print data=employee;
run;
Maxim 2: Read the Log.
It will tell you the answer right there on the spot.
BIG hint: reading the log is always quicker than posting here. Only when you have trouble interpreting the log, come here for guidance.
thanks for your hint, you are so right
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.