Hi, we've just got Sas Viya 3.4 and I'm studying it to understand how can I improve my SAS 9.4 programs.
I have a problem with proc sql, which as I saw exists only as proc fedsql. However, here's my caslib:
caslib mycaslib path="/sas/staging/test" datasource=(srctype="path") libref=mycas;
Inside that path there exists a table named test.sashdat. I load such a table in memory:
proc casutil incaslib="mycaslib" outcaslib="mycaslib";
load casdata="test.sashdat" casout="test" replace;
run;
Now I want, for instance, to aggregate that table to count rows by FIELD1.
proc fedsql;
CREATE TABLE mycas.counts AS
select FIELD, count(*) as N
from mycas.test
group by FIELD;
quit;
I get this error:
ERROR: Table "MYCAS.TEST" does not exist or cannot be accessed
ERROR: BASE driver, schema name MYCAS was not found for this connection
What is wrong?
Thanks
Hi,
You are accessing CAS lib in fedsql but you dont have any session reference of CAS ? It is not a config issue.
cas mySession sessopts=(caslib=
mycas
timeout=3600 locale="en_US" metrics=true);
proc fedsql sessref=mySession;
CREATE TABLE mycas.counts AS
select FIELD, count(*) as N
from mycas.test
group by FIELD;
quit;
I hope this should fix your problem.
Hi, does anyone have the same error or does it happen only on my config?
Thank you
Hi,
You are accessing CAS lib in fedsql but you dont have any session reference of CAS ? It is not a config issue.
cas mySession sessopts=(caslib=
mycas
timeout=3600 locale="en_US" metrics=true);
proc fedsql sessref=mySession;
CREATE TABLE mycas.counts AS
select FIELD, count(*) as N
from mycas.test
group by FIELD;
quit;
I hope this should fix your problem.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
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.