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-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 545 views
  • 0 likes
  • 2 in conversation