Hi,
I'm very new in SAS and I have problem which is difficult to me to settle.
I have two datasets.
First is:
| name | age |
| cole | 12 |
| emma | 13 |
| lisa | 15 |
Second is:
| answer |
| lisa_my_name |
what?? |
How can I merge them by macro only for cases in which answer has values of name variable. The results should be:
| answer | age |
| lisa_my_name | 15 |
Hi @aaaaa34 All you need is a simple inner join or in other words a match merge
proc sql;
create table want as
select a.*,b.*
from second a inner join first b
on answer=name;
quit;
Hi @aaaaa34 All you need is a simple inner join or in other words a match merge
proc sql;
create table want as
select a.*,b.*
from second a inner join first b
on answer=name;
quit;
I edited my post to show you more complex cases.
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 save with the early bird rate—just $795!
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.