SAS – Base Programming – Tutorial 1 – Sort

November 9, 2013 Billy Aung Myint No comments
*Set the library name and path. Note that this is a permanent library.
libname mylib 'd:\temp\prg1';
*Call the proc sort and set output the sorted data , by descending Country and within each country descending Salary
*to temporary library , work.
proc sort data=mylib.sales
      by descending Country descending Salary;
*print from the temp library , but only the Country Last_Name and Salary variables , or columns.
*Remember , columns are variables and rows are observations in SAS
proc print data=work.sales;
      var Country Last_Name Salary;