Can Someone please advise how I can get the final output using Table 1 and Table 2
Thankyou
Are you asking for an inner join?
data have1;
infile cards truncover;
input INST FAC_NUM;
cards;
4265 948
4266 948
;
data have2;
input INST_AM INST_AT FAC_NUM;
cards;
4265 4266 948
;
proc sql;
create table want as
select a.*,INST_AT
from have1 a,have2 b
where a.inst=b.inst_am and a.fac_num=b.fac_num;
quit;
Thankyou but I need two columns the INST_AT as well so how would I modify the code
Also I need to have the repeated row deleted and get the final output as in the EXCEl
proc sql;
create table want as
select a.*,INST_AM,INST_AT
from new a,inst_trans b
where a.id=b.inst_am and a.fac_num=b.fac_num
or a.id=b.inst_at and a.fac_num=b.fac_num ;
quit;
Not sure what you are saying. When i ran -
proc sql;
create table want as
select a.*,INST_AT
from have1 a,have2 b
where a.inst=b.inst_am and a.fac_num=b.fac_num;
quit;
proc print noobs;run;
I get this.
INST | FAC_NUM | INST_AT |
---|---|---|
4265 | 948 | 4266 |
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.