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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1250 views
  • 0 likes
  • 3 in conversation