How to create (is it interleaving problem?) data 'want' from two unrelated data as shown below? In my real data context, the first dataset has 836 unique rows where I'd like to link the second dataset of 210 rows to each row. Sum of resulting number of rows in 'want' dataset would then become n=175,560.
data have1;
input ob1;
datalines;
1
2
3
;
data have2;
input ob2;
datalines;
8
9
;
data want;
input ob1 ob2;
datalines;
1 8
1 9
2 8
2 9
3 8
3 9
;
cross join.
proc sql;
create table want as
select *
from a
cross join b
;
quit;
cross join.
proc sql;
create table want as
select *
from a
cross join b
;
quit;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.