Hi All,
Has anyone experienced joining tables from SAS and Athena?
I have a requirement of joining table one in SAS and another in Athena.
proc sql noprint;
connect to ODBC as athn (DSN="AWS-Athena-SAS-xxx-xxx" );
create TABLE data.join(compress=char) as
select base.*
from connection to athn
(
Select A.id
from data.table_in_sas A
INNER JOIN table_in_s3 B
ON A.id = B.id
) base;
disconnect from athn;
quit;
Hi All,
Has anyone experienced joining tables from SAS and Athena?
I have a requirement of joining table one in SAS and another in Athena.
proc sql noprint;
connect to ODBC as athn (DSN="AWS-Athena-SAS-xxx-xxx" );
create TABLE data.join(compress=char) as
select base.*
from connection to athn
(
Select A.id
from data.table_in_sas A
INNER JOIN table_in_s3 B
ON A.id = B.id
) base;
disconnect from athn;
quit;
There was a double post which I merged. I forgot to activate the notification, sorry for that.
@ChrisNZ wrote:
I usually mark the second post as spam.
Haven't considered that (yet). Will do a meditation on it.
Hope confusion is clear now. That wasn't intentional to ask same question again, but by mistake might have submited the same question twice.
@ChrisNZ I will try your solution tomorrow and see if it works.
This is not possible with any data base.
The join must take place where both tables are.
So either you download the athena table to sas or you upload the sas table to athena.
The does the former:
libname ATH odbc DSN="AWS-Athena-SAS-xxx-xxx" user=xxx etc ;
proc sql ;
create table SASLIB.TAB3 as
select *
from ATH.TAB1, SASLIB.TAB2
where ID1=ID2;
quit;
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.