below example how to get only first row in output
proc freq data=sashelp.class; tables age;run;
need only highlited in output window instead of getting all
PROC FREQ prints the whole table (or alternatively, none of the table). But you can work around that if you find a slightly different report format satisfactory:
proc freq data=have;
tables age / noprint out=counts;
run;
proc print data=counts (obs=1);
run;
Another way:
proc freq data=sashelp.class noprint;
tables age / out=counts;
run;
proc sql;
create table firstCount as
select * from counts
having age=min(age);
select * from firstCount;
quit;
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.