Greetings,
I am new to FED SQL. I get the following error when I want to pull a table from SAS Base to CASLIB. What is the reason?
Code:
libname STG_DATA "/datastagingarea/STGLIB"; cas mySession sessopts=(caslib=analytic timeout=3600 locale="en_US" metrics=true); proc fedsql sessref=mySession; create table analytic.FED_SQL2{options replace=true replication=0} as select * from stg_data.POS_TEST as t1 ;quit ;
Error Message:
1 %studio_hide_wrapper; 83 proc fedsql sessref=mySession; 84 create table analytic.FED_SQL2{options replace=true replication=0} as 85 select * 86 from stg_data.POS_TEST as t1 87 ; 87 ! quit ; NOTE: Executing action 'fedSql.execDirect'. ERROR: The caslib STG_DATA does not exist or could not be accessed. ERROR: Table "STG_DATA.POS_TEST" does not exist or cannot be accessed ERROR: The action stopped due to errors. NOTE: Action 'fedSql.execDirect' used (Total process time): NOTE: real time 0.043427 seconds NOTE: cpu time 0.056188 seconds (129.38%) NOTE: total nodes 5 (72 cores) NOTE: total memory 1.11T NOTE: memory 5.86M (0.00%) ERROR: The FedSQL action was not successful. NOTE: PROC FEDSQL has set option NOEXEC and will continue to prepare statements. NOTE: PROCEDURE FEDSQL used (Total process time): real time 0.12 seconds cpu time 0.01 seconds 88 89 90 %studio_hide_wrapper; 101 102
Extra: Is there any way to save the table as sashdat to caslib with Fed SQL, what is the best-practice?
It seems so, I get an error as well, even if I don't state a CAS session in the proc.
But proc sql works.
Do you need it to be FedSQL specifically?
I think that you need to upload your stg_data table to CAS to make it available for your CAS session.
SAS Help Center: Load Data to a Caslib
Hi LinusH,
Thanks for answering. As far as I understand it is not possible to load a sas table to cas by using Fed SQL which is my main goal.
Is it correct?
It seems so, I get an error as well, even if I don't state a CAS session in the proc.
But proc sql works.
Do you need it to be FedSQL specifically?
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.