Data one; input var1 $;
datalines;
scan
MRI
;run;
Data two; input res1 res2;
datalines;
10
45
13
56
; run;
OUTPUT: IN ONE DATASET
Var1 res1 res2
scan 10 45
scan 13 56
MRI 10 45
MRI 13 56
The SQL solution already posted is easier, but for a DATA step:
data want;
set one;
do _n_=1 to _nobs_;
set two point=_n_ nobs=_nobs_;
output;
end;
run;
Please provide valid and tested SAS syntax creating DATA ONE and DATA TWO.
Untested (as I didn't feel like fixing the data steps)
proc sql;
create table want as
select *
from one,two
;
quit;
Hereafter It will not repeat and Thank you!
Can you please help out In Data Step Method ...for the same Problem
The SQL solution already posted is easier, but for a DATA step:
data want;
set one;
do _n_=1 to _nobs_;
set two point=_n_ nobs=_nobs_;
output;
end;
run;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.