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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.