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;
View solution in original post
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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Latest Updates
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.