Hi,
I need to combine the following 3 datasets based on parameters - treatment, x, y.
I thought of giving a sort oder for each dataset and using Union Corr. But not sure if it is the right way.
|
Data1 |
Grade1 |
|||
|
treatment |
x |
|||
|
sugar |
ab |
2 |
||
| bp | cd | 3 | ||
|
Data2 |
||||
|
treatment |
x |
y |
Grade1 |
|
|
sugar |
ab |
nausea |
2 |
|
|
sugar |
ab |
headache |
1 |
|
|
bp |
cd |
jaundice |
3 |
|
|
Data3 |
||||
|
treatment |
x |
y |
z |
Grade1 |
|
sugar |
ab |
nausea |
vomit |
2 |
|
sugar |
ab |
nausea |
dizziness |
4 |
|
sugar |
ab |
headache |
tummy pain |
1 |
|
bp |
cd |
jaundice |
fever |
1 |
|
bp |
cd |
jaundice |
hig temp |
3 |
|
Output: |
||||
|
treatment |
x |
y |
z |
Grade1 |
|
sugar |
ab |
2 |
||
|
sugar |
ab |
nausea |
2 |
|
|
sugar |
ab |
nausea |
vomit |
2 |
|
sugar |
ab |
nausea |
dizziness |
4 |
|
sugar |
ab |
headache |
1 |
|
|
sugar |
ab |
headache |
tummy pain |
1 |
|
bp |
cd |
3 |
||
|
bp |
cd |
jaundice |
3 |
|
|
bp |
cd |
jaundice |
fever |
1 |
|
bp |
cd |
jaundice |
hig temp |
3 |
How do I achieve this?
Thanks,
Archana
How import is that exact order? If the idea is to group by treatment, x, y, z then
data want;
set data1 data2 data3;
run;
proc sort data=want;
by treatment x y Grade1 z;
run;
may get you close.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.