Dear,
I need help in my pgm to filter records based on non-missing values. In my output I need records with non missing values in at least in one variable(CQ11NAM -CQ14NAM) (SMQ01nam-SMQ04NAM). I tried CMISS function and list all variables here. But in my actual data I have more than 60 variables. Please suggest. Thank you
data one;
input CQ11NAM $1 CQ12NAM $3 CQ13NAM $5 CQ14NAM $7 SMQ01NAM $9 SMQ02NAM $11 SMQ03NAM $13 SMQ04NAM $15 id 17;
DATALINES;
a 3
a 2
1
d 5
f 4
;
data two;
set one;
if cmiss(of CQ11NAM-CQ14NAM,of SMQ01NAM-SMQ04NAM) lt 8 then flag='Y';
if flag='Y';
run;
Use the double dash like this
data two;
set one;
if cmiss(of CQ11NAM -- SMQ04NAM) < 8;
run;
A nice article on creating variable lists is 6 easy ways to specify a list of variables in SAS.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.