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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Data have;

set want;

where PersonalID In ( 'Q1111'  'Q1114'  'Q1117'   'Q1123'  'Q1127'  Q1129');

run;

View solution in original post

4 REPLIES 4
Reeza
Super User

What did you try?

Sapkota
Calcite | Level 5

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;

Reeza
Super User

Data have;

set want;

where PersonalID In ( 'Q1111'  'Q1114'  'Q1117'   'Q1123'  'Q1127'  Q1129');

run;

Sapkota
Calcite | Level 5

Thank you much!

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 1400 views
  • 0 likes
  • 2 in conversation