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!
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.