I would like to merge two data sets as an example below. Could you kindly advise?
Thank you very much in advance
HAVE_1
FIRM
1
2
HAVE_2
DATE
12/08/2017
22/12/2018
06/10/2019
WANT
FIRM DATE
1 12/08/2017
1 22/12/2018
1 06/10/2019
2 12/08/2017
2 22/12/2018
2 06/10/2019
Try cartesian
proc sql;
create table want as
select firm, date
from have_1, have_2;
quit;
Try cartesian
proc sql;
create table want as
select firm, date
from have_1, have_2;
quit;
Many thanks @novinosrin ![]()
data have_1;
input firm;
datalines;
1
2
;
data have_2;
input date :ddmmyy10.;
format date ddmmyy10.;
datalines;
12/08/2017
22/12/2018
06/10/2019
;
data want;
set have_1;
do i=1 to n;
set have_2 point=i nobs=n;
output;
end;
run;
Thank a lot @PeterClemmensen
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!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.