Hi Team,
I have 2 datasets First dataset name is Part1 and other is Part2..
in Part1 have some subjects and information and PArt2 has some other Subjects information
Now i need to set these 2 datasets using subject, and the condition is if Part1 and Part2 have same subjects then I need to display only the information from Part1 dataset while setting or merging
Could you please help me on these
Like this?
I'm hoping you can provide some data.
data part1;
input subjid info1 $;
datalines;
1 abc
2 def
4 ghi
5 jkl
8 mno
;
run;
data part2;
input subjid info2 $;
datalines;
2 pqr
4 stu
6 vwx
7 yz_
;
run;
data want;
set part1 part2;
by subjid;
if first.subjid;
run;
Can you provode some sample data?
Is it set or merge that needs to be done?
Like this?
I'm hoping you can provide some data.
data part1;
input subjid info1 $;
datalines;
1 abc
2 def
4 ghi
5 jkl
8 mno
;
run;
data part2;
input subjid info2 $;
datalines;
2 pqr
4 stu
6 vwx
7 yz_
;
run;
data want;
set part1 part2;
by subjid;
if first.subjid;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.