Hello,
How does CALL SORTC or CALL SORTN work? Is it a horizontal sorting of the variables?
The following program does not seem to make any changes.
data test;
set sashelp.class;
call sortn (age, height);
run;
Compare the differences in Example and Example2 in the code below:
data example; input v1 v2 v3; datalines; 1 2 3 3 1 2 27 18 4 ; run; data example2; set example; call sortn (v1,v2,v3); run;
@SAS_inquisitive wrote:
The following program does not seem to make any changes.
That's because age is always less than height anyways. Make a better examle where the order would change to test it properly.
@SAS_inquisitive Reeza rightly mentioned to work on better examples. My suggestion is, if you don't mind and can afford to buy a book, try to get this-
https://www.sas.com/store/prodBK_60864_en.html?storeCode=SAS_US&storeCode=SAS_US
Learning SAS® by Example: A Programmer's Guide
Awesome, I wish I could have at least one. Please do post, I'll learn too.Thank you!
This is learning and knowledge sharing forum. One should take it easy to each other.
Compare the differences in Example and Example2 in the code below:
data example; input v1 v2 v3; datalines; 1 2 3 3 1 2 27 18 4 ; run; data example2; set example; call sortn (v1,v2,v3); run;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.