BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
statsgal
Calcite | Level 5

I have a dataset from a longitudinal study where we collected data by waves. I want to create a new table. I want to keep participants (who are organized by id) who answered all questions (labeled a, b, c, and d) for at least one wave. This was my previous code:

proc sql;
	create table only as select * from full group by id having 
		not (a eq . and b eq . and c eq . and d eq .)
		order by id, wave;
quit;

However, with this code, I filter by keeping participants who answered any of these questions by at least one wave. . How can I go about fixing this?

1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Try this:

 

proc sql;
	create table only as 
	select * from full 
	where id in (
		select id
		from full 
		where cmiss(a, b, c, d) = 0 )
	order by id, wave;
quit;
PG

View solution in original post

1 REPLY 1
PGStats
Opal | Level 21

Try this:

 

proc sql;
	create table only as 
	select * from full 
	where id in (
		select id
		from full 
		where cmiss(a, b, c, d) = 0 )
	order by id, wave;
quit;
PG

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

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 717 views
  • 1 like
  • 2 in conversation