Hello,
I want to multiply table 1 with table 2.
Thanks for your help.
Table 1 | Table 2 | Want | ||||
Name | DAFMS | |||||
DAFMS | Name | DIDIER | 31OCT2018 | |||
31OCT2018 | DIDIER | DIDIER | 31JAN2018 | |||
31JAN2018 | Gérard | DIDIER | 30SE2019 | |||
30SE2019 | william | DIDIER | 31JUL2019 | |||
31JUL2019 | DIDIER | 31MAY2019 | ||||
31MAY2019 | DIDIER | 28FEB2019 | ||||
28FEB2019 | DIDIER | 30JUN2019 | ||||
30JUN2019 | DIDIER | 30APR2019 | ||||
30APR2019 | DIDIER | 31AUG2019 | ||||
31AUG2019 | DIDIER | 30NOV2018 | ||||
30NOV2018 | DIDIER | 31DEC2018 | ||||
31DEC2018 | DIDIER | 31MAR2019 | ||||
31MAR2019 | Gérard | 31OCT2018 | ||||
Gérard | 31JAN2018 | |||||
Gérard | 30SE2019 | |||||
Gérard | 31JUL2019 | |||||
Gérard | 31MAY2019 | |||||
Gérard | 28FEB2019 | |||||
Gérard | 30JUN2019 | |||||
Gérard | 30APR2019 | |||||
Gérard | 31AUG2019 | |||||
Gérard | 30NOV2018 | |||||
Gérard | 31DEC2018 | |||||
Gérard | 31MAR2019 | |||||
william | 31OCT2018 | |||||
william | 31JAN2018 | |||||
william | 30SE2019 | |||||
william | 31JUL2019 | |||||
william | 31MAY2019 | |||||
william | 28FEB2019 | |||||
william | 30JUN2019 | |||||
william | 30APR2019 | |||||
william | 31AUG2019 | |||||
william | 30NOV2018 | |||||
william | 31DEC2018 | |||||
william | 31MAR2019 |
Data table1;
input DAFMS $;
cards;
31OCT2018
31JAN2018
30SE2019
31JUL2019
31MAY2019
28FEB2019
30JUN2019
30APR2019
31AUG2019
30NOV2018
31DEC2018
31MAR2019
run;
Data table2;
input Name $;
cards;
DIDIER
Gérard
william
run;
proc sql;
create table want as
select Name,DAFMS
from table2
cross join
table1;
quit;
DataStep Solution :
data want;
set table2;
do p=1 to n;
set table1 point=p nobs=n;
output;
end;
run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.