BookmarkSubscribeRSS Feed
Vic1809
Calcite | Level 5

I would like to be able to use BULKUPLOAD and BL_NUM_READ_THREADS when connected to Snowflake.  Sample code follows.

 

%let cmsid = &_METAUSER;

proc sql noprint;

connect to snow as x1 (DATABASE=ADM_PRD  DSN=Snowflake_OPI

  CONOPTS="authenticator=https://xxx.xxx.xxx?snowflake=okta" role=OPIC_ADM_OPI_RWC_P

  SCHEMA=CMS_ADM_OPI authdomain=SNOW_Auth bl_internal_stage="user/&cmsid" BULKUNLOAD=YES);

EXECUTE (create or replace table FIVE_YEARS_HOS as … (many more fields specified)

 

SAS will not complain when I submit this code and it completes in 7.87s.  The query never shows up in the Snowflake Classic UI History.  Without the BULKUNLOAD=YES option the query runs for 32min 30s. and the table is created.

2 REPLIES 2
SASKiwi
PROC Star

Where is your source data coming from? A SAS table or some other source? If its a SAS table then I suggesting trying an APPEND. If the table doesn't already exist it should be created:

libname MySnow snow DATABASE=ADM_PRD  DSN=Snowflake_OPI 
  CONOPTS="authenticator=https://xxx.xxx.xxx?snowflake=okta" role=OPIC_ADM_OPI_RWC_P
  SCHEMA=CMS_ADM_OPI authdomain=SNOW_Auth bl_internal_stage="user/&cmsid" insertbuff = 10000;

proc datasets library = MySnow nolist;
  append base = MySnowTable data = WORK.MySASTable;
run;
quit;

Once it is working without bulk loading then try with options BULKLOAD = Y and BULKUNLOAD = Y. 

LinusH
Tourmaline | Level 20

Assuming that BULKUPLOAD in the subject is a typo for BULKUNLOAD.

I am a little confused, and probably due to ignorance.

SAS doc ties these options to LIBNAME statement.

I guess they could work wit an PROC SQL CONNECT TO as well.

But code within an excute block is usually executed only in the target DBMS, so I would assume that your SAS specific options shouldn't affect the execution.

It would help to see more of the code inside the EXECUTE block, but perhaps not all column names...

Why are you using CONNECT TO? What happens if you try to use a libref instead? Then you could use these option to track Snowflake behaviour:

options msglevel=i sastrace=',,,d' sastraceloc=saslog nostsuffix;

If there's any unclarity in the doc or connection behaviour, you might want to try contacting SAS tech  support.

Data never sleeps

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 530 views
  • 0 likes
  • 3 in conversation