BookmarkSubscribeRSS Feed
GS2
Obsidian | Level 7 GS2
Obsidian | Level 7

Using SAS 9.4

 

I have multiple questions with this post. 

 

I need to sum across the column to create a total volume. However, I will not be adding all columns I need to add all the columns that are NOT zero or the column to the immediate left of a zero but I am not sure how to code to make this possible. As you can see from the image I attached the column of a zero varies which means the column to the immediate left varies. Each row is a unique study ID. I also need a count of how many measurements went into the total volume. I need to do this with multiple groupings of variables

 

I have time points pre, 2 week and, 6 week. In each time point are SL and CL measurements. Within each SL and CL I need the same count of measurements across all 3 time points. So that would be 6 individuals counts that must be the same in order to sum those into one final total column.

 

This is as clear as mud but I am happy to try answer answer questions about the endpoints I want. Before you ask I am prohibited from posting any data, I realize it would make it easier but those are the rules. Thank you for any thoughts!

1 REPLY 1
PGStats
Opal | Level 21

It doesn't have to be your actual data. Just make some up and show what the intended output should be. Try to account for every possibility in the data.

PG

sas-innovate-white.png

🚨 Early Bird Rate Extended!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Lock in the best rate now before the price increases on April 1.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 427 views
  • 0 likes
  • 2 in conversation