Hi , I am using the below query to join multiple tables using proc sql. Is it possible to perform the same in a data step ?
Could you please help me translate this in data step?
proc sql;
create table work.cte as
select distinct el.flag,
el.balance,
el.daysdelinq,
c.country,
c.postcode,
a.balance,
a.cl,
a.daysdelinq as daysdelinq_2,
a.schufaindicator,
a.finaccno as acct,
c.customerno,
el.row_no
from work.pes_row el,
pxm.accounts a,
pxm.accxref aref,
pxm.contacts c
where el.finaccno = a.finaccno
and a.acc = aref.acc
and aref.customerno = c.customerno
and a.finaccno in (select finaccno from work.acc_list_cards);
quit;
Thank you
Are you obliged to do that with data set ?
Because you are merging 4 tables.
You can do the same in SAS using merge.
But it is very long because you have to sort each table by the id and merge 4 times (i think)
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.