Hi All,
I want to create a sub-dataset 'have' where the 'personalID' are only 'Q1111' , 'Q1114', 'Q1117', 'Q1123', 'Q1127', 'Q1129' from the following dataset 'Want'.
I tried different codes but did not succeed. Any help is highly appreciated. Thanks in advance.
personalID VariableA VariableB
Q1111 131.32 56.43
Q1112 132.21 65.34
Q1113 167.23 70.23
Q1114 145.34 56.34
Q1115 135.12 98.56
Q1116 145.56 99.42
Q1117 123.45 76.33
Q1118 167.43 87.34
Q1119 189.12 98.32
Q1120 145.23 93.23
Q1121 129.23 93.23
Q1122 167.34 98.32
Q1123 187.23 76.34
Q1124 179.23 88.65
Q1125 175.34 45.24
Q1126 136.23 54.23
Q1127 181.23 59.56
Q1128 173.43 60.34
Q1129 190.23 91.23
Q1130 191.12 93.21
Data have;
set want;
where PersonalID In ( 'Q1111' 'Q1114' 'Q1117' 'Q1123' 'Q1127' Q1129');
run;
What did you try?
Thank you. I tried this but did not work. What did I do incorrect?
Data have;
set want;
where 'PersonalID'= 'Q1111' 'Q1114' 'Q1117' 'Q1123' 'Q1127' Q1129';
run;
Data have;
set want;
where PersonalID In ( 'Q1111' 'Q1114' 'Q1117' 'Q1123' 'Q1127' Q1129');
run;
Thank you much!
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.