Hi everyone!
I have a SAS question about how to remove some values in a row and only keep the first column and the last column which is the total. Thanks so much!
The easiest thing to do is simply delete variables c0 through c4.
Clarification: I said delete the variables, not delete the values.
data want;
set have;
drop c0-c4;
run;
You would have to have a missing value which is a dot, as these variables are numeric.
In a SAS data step, use
call missing(c0,c1,c2,c3,c4);
@PaigeMiller wrote:
You would have to have a missing value which is a dot, as these variables are numeric.
In a SAS data step, use
call missing(c0,c1,c2,c3,c4);
Or for a little added flair
call missing(of c0-c4);
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.
Ready to level-up your skills? Choose your own adventure.