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

Hi everyone,

 

I am using SAS EG 8.3 to query Snowflake database. I wrote a query like below:

 

proc sql;
select count(*) as cnt from (
select
   col1, col2, col3... (there are 12 columns)
from tbl1
inner join tbl2
on ...
inner join tbl3
on ...
where ...
)
quit;

the expected cnt should be 337,947 because I ran similar code in snowflake successfully (less than 1 minute). But I got errors saying 

  • ERROR: Insufficient space in file WORK.'SASTMP-000000054'.UTILITY.
  • ERROR: File WORK.'SASTMP-000000054'.UTILITY is damaged. I/O processing did not complete.
  • ERROR: There is not enough space to store some intermediate results during join processing.

My question is how to modify the code so it can run in SAS? Because I need the 337,947 records for further analysis. 

To me, I feel the code is trying to pull all data into local machine before aggregation. Is the code supposed to be run in Snowflake?

 

Thanks! 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Move it into the Snowflake server.

 

Say you have a libref named SNOW pointing to Snowflake then use code like:

proc sql;
connect using snow;
select cnt from connection to snow (
select count(*) as cnt from (
select
   col1, col2, col3... (there are 12 columns)
from tbl1
inner join tbl2
on ...
inner join tbl3
on ...
where ...
))
;
quit;

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

Move it into the Snowflake server.

 

Say you have a libref named SNOW pointing to Snowflake then use code like:

proc sql;
connect using snow;
select cnt from connection to snow (
select count(*) as cnt from (
select
   col1, col2, col3... (there are 12 columns)
from tbl1
inner join tbl2
on ...
inner join tbl3
on ...
where ...
))
;
quit;
sonnysangBB
Calcite | Level 5

it works! Thank you @Tom 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 412 views
  • 2 likes
  • 2 in conversation