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!

sas-innovate-2024.png

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.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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