After sorting the rows, I want to PRINT the top 5 rows only (the top five highest values for FacilityCountry). I have tried to use (OBS=5) in the PROC PRINT date= statement, but it does not work. Looking for ideas.
DATA MIS543.TOYS2;
SET MIS543.TOYS;
KEEP FacilityCountry Sales;
RUN;
PROC REPORT DATA=MIS543.TOYS2 OUT=MIS543.TOYSTABLE;
column FacilityCountry Sales;
define FacilityCountry / "Country" group order=data;
define Sales / "Sales" sum;
format Sales DOLLAR14.;
RUN;
PROC SORT DATA=MIS543.TOYSTABLE;
BY descending Sales;
RUN;
PROC PRINT DATA=MIS543.TOYSTABLE LABEL NOOBS style(header obsheader)=[fontsize=4 color= darkgreen backgroundcolor=lightcyan];
VAR FacilityCountry / style(data)=[fontsize=3 fontweight=bold color=DARKGREEN];
VAR Sales / style(data)=[fontsize=3 fontweight=bold color=DARKGREEN];
title c=darkgreen bold h=5 "Top Five Countries with the Most Sales";
RUN;
TITLE;