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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.