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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.