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 now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.