BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11

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;

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
alepage
Barite | Level 11

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;

View solution in original post

6 REPLIES 6
LinusH
Tourmaline | Level 20

By using the USING keyword:

proc sql;
   connect using CNTPMDU;
   ....
   disconnect from CNTPMDU;
quit;

But it needs the libname to be set prior.

Data never sleeps
alepage
Barite | Level 11

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.

 

 

LinusH
Tourmaline | Level 20
You didn't read my example properly:
connect using CNTPMDU;

Nothing else.

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/acreldb/n0rn6hhsizv3trn1cl3e0ofosawi.htm
Data never sleeps
alepage
Barite | Level 11

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

alepage
Barite | Level 11

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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

Creating Custom Steps in SAS Studio

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 443 views
  • 0 likes
  • 3 in conversation