* Sheep Example Show various options in proc print Reference: David Franklin, PROC PRINT - the Granddaddy of all Procedures, Enhanced and Still Going Strong! http://www.lexjansen.com/nesug/nesug11/ds/ds09.pdf; options ls=70 nodate pageno=1; data sheep_numbers; length Country $25 Year Number 8.; infile 'c:/datasets/sheep-numbers.txt' firstobs=4; * Ampersand ( & ) in input statement means keep reading character variable until two blanks are encountered; input country $ & year number; title1 "Sheep Numbers in Select Countries, By Year"; footnote1 "Note: Numbers for India are FAO Estimate"; footnote2 "Source: UNData, 03Nov2010"; * Version 1: Basic Output; proc print data=sheep_numbers; var country year number; format number comma12.; title2 'Basic Output'; * Version 2: noobs and label options; proc print data=sheep_numbers noobs label; var country year number; format number comma12.; label country='Country' year='Year' number='Reported Number'; title2 "Something a Little Better, with labels."; * Version 3: Display by country with id=country; proc print data=sheep_numbers label; by country; id country; var year number; format number comma12.; label country='Country' year='Year' number='Reported Number'; title2 "Something even better, with by and id"; * Version 4: Use the sum and n options to display country sums and counts; proc print data=sheep_numbers label n='Country Count = ' 'Total Count = '; title2 'Output using the sum Statement'; by country; id country; var year number; format number comma18.; label country='Country' year='Year' number='Reported Number'; sum number; run; quit;