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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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