BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

I want to calculate for each loan ID  (Field Agreement_Account_Id) the max Fund_Actual_Payment_Count.

I run it in SAS and I get an error "Teradata row not delivered (trget): No more spool space in udkdw02".

What should I do in order to run successful query that calculate max for each loan ID? 

Please note that the raw data data set contain 508,264,076 rows

 

proc sql;
create table VBM410_ACTIVE_LOAN_BAL as
select Agreement_Account_Id,
       MAX(Fund_Actual_Payment_Count) as  Mis_Tash_Paid 
FROM TeraData.VBM410_ACTIVE_LOAN_BAL
group by Agreement_Account_Id 
;
quit;
/*ERROR: Teradata row not delivered (trget): No more spool space in udkdw02.*/

When I run it via proc summary then it is running well!

My questions:

Why proc sql is not working well here?

Is there better  more efficient way to run it than proc summary?

proc summary data=TeraData.VBM410_ACTIVE_LOAN_BAL(Where=(Agreement_Account_Id not in (0,.)));
var Fund_Actual_Payment_Count;
class Agreement_Account_Id;
output out=VBM410_ACTIVE_LOAN_BAL max=Mis_Tash_Paid;
run;
1 REPLY 1
Patrick
Opal | Level 21

This looks like Teradata not having sufficient work space. I'd raise this with your SAS admin or eventually directly with your Teradata DBA. 

It's possible that changing the readbuff option to a lower value would also allow the SQL to execute.

 

You have a where clause in your Proc Summary code that doesn't exist in your SQL code. We also can't know what code exactly SAS sends to the database for execution. 

 

If you add below options to your code then you'll get in the SAS log what SAS sends to Teradata for in-database execution. 

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

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 1 reply
  • 272 views
  • 0 likes
  • 2 in conversation