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

Hi i want to count total number of cases in data set .

The data has variable status so want to count total no of cases based on the values of status.

filter should be where status=cr then the total count should be stored in new variable.

if status-ct then count of ct in new variable.

 

 

1 ACCEPTED SOLUTION
5 REPLIES 5
anirudhs
Obsidian | Level 7
Thanks Kurt ,
any solution how can we implement it using the query builder.
and any data step
anirudhs
Obsidian | Level 7
Hi Kurt,
i used the following sum(case when status=ct then 1 else 0) which gave me the the count of ct cases in the data set similarly i did it for the other case where i got the required o/p using the query builder and designed the automated process flow.

Thanks for your help.
Anirudh
Reeza
Super User


That's three questions in one.

 


@anirudhs wrote:

Hi i want to count total number of cases in data set .

 

 


 

Use a summarization task

 


@anirudhs wrote:

 

The data has variable status so want to count total no of cases based on the values of status.

 

 


Again, a Summary task will produce that. 

 


@anirudhs wrote:

 

if status-ct then count of ct in new variable.

 

 


In a separate data set, how do you need that stored? You can use Query builder with a filter or you could save the results from the summary tasks into a dataset for use later.

 

It seems like all your results could be handled with a summarization procedure.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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