BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mona4u
Lapis Lazuli | Level 10

Hi, 

I'm using proc report to produce a report and I need a way to count the number of "Y" in the column  

Site Approved (Y/N)
 
 
Y
 
Y
Y
 
 
 
 
 
 
 
Y
 
 
 
Y
Y
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Idea 1:

This could be done easily in a data step before PROC REPORT.

 

Idea 2:

If the value of the variable is 1 or 0, instead of Y or blank, then you could just sum up the columns in PROC REPORT

--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Idea 1:

This could be done easily in a data step before PROC REPORT.

 

Idea 2:

If the value of the variable is 1 or 0, instead of Y or blank, then you could just sum up the columns in PROC REPORT

--
Paige Miller
mona4u
Lapis Lazuli | Level 10

I have same question I have dates in the columns and I need to count how many rows has dates on them I dont know how to use if stament to count one each time there is a date value 

Date Physical Submission Start Up Kit Sent to Site
 
 
 
6-Jun-17
28-Jul-17
12-May-17
 
 
6-Sep-17
 
 
 
 
 
 
 
 
 
8-Jun-17
 
13-Jul-17
 
N/A
 
 
 
 
 
 
 
 
 
 
 
 
23-May-17
 

 

PaigeMiller
Diamond | Level 26

In a data step

 

if not missing(date) then count+1;
--
Paige Miller

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 791 views
  • 2 likes
  • 2 in conversation