BookmarkSubscribeRSS Feed
ybz12003
Rhodochrosite | Level 12

Hello,

A question for Proc report.  If I would like to get counts for column "Test_group" by using Proc report, is it possible?  That column is text character, and I would like to restrict the condition to ">=1" .  Please advice.

proc report data=Have;
        column State Year Quarter Positive Test__groups_;
        define Test__groups_/group 'Test Group le 1' order=data;
run;
2 REPLIES 2
ballardw
Super User

Input data and what you want for output as examples. Since you don't show any details about what the other four variables contribute to the report it is hard to be sure what you want/expect.

Since you don't show any column to place the "count" into I am moderately sure that inside Proc report is not the place.

 

 

 

Count  and filter the data?

proc freq data=Have noprint;
   tables State *Year* Quarter* Positive* Test__groups_/out=counts (where=(count ge 1));
run;

and print the data set counts.

 

 

 

 

tarheel13
Rhodochrosite | Level 12

could you post your dataset? 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 1069 views
  • 0 likes
  • 3 in conversation