Please note that the macro variable values are not provided for security purpose. Also, we don't use a user and password to connect but we use an authodomain.
I would like to convert the SnowFlake SAS connector below into a PROC SQL for a passthrough connection
How to do that. PLease provide an example
LIBNAME CNTPDMU SASIOSNF
DATABASE=&databaseName
SERVER="&ServerName"
SCHEMA=&Schema
AuthDomain="&autodomain.";
run;
This SAS snippet is working:
%LET cn_SNOW = database=&databaseName.
SQL_FUNCTIONS=ALL
SERVER="&serverName."
SCHEMA=&schema.
AUTHDOMAIN=&authdomain.;
proc sql;
connect to snow(&cn_SNOW.);
create table mydata as
select * from connection to snow (
select * from CONTRACTPL_DM.FCT_PL_COV_DRVR_PREM factPremium
) ;
disconnect from snow;
quit;
By using the USING keyword:
proc sql;
connect using CNTPMDU;
....
disconnect from CNTPMDU;
quit;
But it needs the libname to be set prior.
I have tried the script below but it say invalid :ERROR: Invalid option name LIBNAME.
LIBNAME CNTPDMU SASIOSNF
DATABASE=&databaseName
SERVER="&ServerName"
SCHEMA=&Schema
AuthDomain="&autodomain.";
run;
/********** passthrough connector *****/
PROC SQL;
CONNECT TO SNOW (LIBNAME=CNTPDMU); /* Connect using the established LIBNAME */
EXECUTE (
SELECT * CNTPDMU.FCT_PL_COV_DRVR_PREM factPremium
) BY SNOW;
DISCONNECT FROM SNOW;
QUIT;
NOTE: Credential obtained from SAS metadata server.
NOTE: Libref CNTPDMU was successfully assigned as follows:
Engine: SNOW
.....
/********** passthrough connector *****/
37
38 PROC SQL;
39 CONNECT TO SNOW (LIBNAME=CNTPDMU);
ERROR: Invalid option name LIBNAME.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
39 ! /* Connect using the established LIBNAME */
40
41 EXECUTE (
42 SELECT * CNTPDMU.FCT_PL_COV_DRVR_PREM factPremium
43 ) BY SNOW;
NOTE: Statement not executed due to NOEXEC option.
NOTE: Credential obtained from SAS metadata server.
NOTE: Libref CNTPDMU was successfully assigned as follows:
Engine: SNOW
Physical Name: ifcedpnprd.ca-central-1.privatelink.snowflakecomputing.com
39 run;
40
41
42 /********** passthrough connector *****/
43
44 proc sql;
45 connect using CNTPMDU;
ERROR: Libref CNTPMDU is not assigned.
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
46
47 EXECUTE (
48 SELECT * from CNTPDMU.FCT_PL_COV_DRVR_PREM factPremium
49 ) ;
2 The SAS System 08:25 Monday, November 17, 2025
_
22
ERROR 22-322: Expecting a name.
50
51 disconnect from CNTPMDU;
NOTE: Statement not executed due to NOEXEC option.
52 quit;
NOTE: The SAS System stopped proc
Please provide an a complete example
This SAS snippet is working:
%LET cn_SNOW = database=&databaseName.
SQL_FUNCTIONS=ALL
SERVER="&serverName."
SCHEMA=&schema.
AUTHDOMAIN=&authdomain.;
proc sql;
connect to snow(&cn_SNOW.);
create table mydata as
select * from connection to snow (
select * from CONTRACTPL_DM.FCT_PL_COV_DRVR_PREM factPremium
) ;
disconnect from snow;
quit;
Compare the names:
NOTE: Libref CNTPDMU was successfully
and
45 connect using CNTPMDU;
See the difference?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.