BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Ravikumarpa4
Obsidian | Level 7

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

Untitled.png

1 ACCEPTED SOLUTION

Accepted Solutions
lakshmi_74
Quartz | Level 8
proc freq data=sashelp.class(where=(age=11));
tables age;run;

View solution in original post

3 REPLIES 3
Astounding
PROC Star

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;

lakshmi_74
Quartz | Level 8
proc freq data=sashelp.class(where=(age=11));
tables age;run;
PGStats
Opal | Level 21

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;
PG

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2001 views
  • 1 like
  • 4 in conversation