BookmarkSubscribeRSS Feed
WilliamB
Obsidian | Level 7

Hello,

 

I want to multiply table 1 with table 2.

 

 

Thanks for your help.

 

Table 1  Table 2  Want 
     NameDAFMS
DAFMS Name  DIDIER31OCT2018
31OCT2018 DIDIER  DIDIER31JAN2018
31JAN2018 Gérard  DIDIER30SE2019
30SE2019 william  DIDIER31JUL2019
31JUL2019    DIDIER31MAY2019
31MAY2019    DIDIER28FEB2019
28FEB2019    DIDIER30JUN2019
30JUN2019    DIDIER30APR2019
30APR2019    DIDIER31AUG2019
31AUG2019    DIDIER30NOV2018
30NOV2018    DIDIER31DEC2018
31DEC2018    DIDIER31MAR2019
31MAR2019    Gérard31OCT2018
     Gérard31JAN2018
     Gérard30SE2019
     Gérard31JUL2019
     Gérard31MAY2019
     Gérard28FEB2019
     Gérard30JUN2019
     Gérard30APR2019
     Gérard31AUG2019
     Gérard30NOV2018
     Gérard31DEC2018
     Gérard31MAR2019
     william31OCT2018
     william31JAN2018
     william30SE2019
     william31JUL2019
     william31MAY2019
     william28FEB2019
     william30JUN2019
     william30APR2019
     william31AUG2019
     william30NOV2018
     william31DEC2018
     william31MAR2019
2 REPLIES 2
r_behata
Barite | Level 11
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;
r_behata
Barite | Level 11

DataStep Solution :

 

data want;
	set table2;

	do p=1 to n;
		set table1 point=p nobs=n;
		output;
	end;
run;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 608 views
  • 0 likes
  • 2 in conversation