MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Avoid insufficient dataset space

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Tue Jun 15, 2010 9:22 am    Post subject: Avoid insufficient dataset space Reply with quote

I have a REXX program runs in batch extracting rows from DB2 tables then writing records (EXECIO) to a sequential dataset. I allocated sufficient tracks for the dataset. In rare occasion, there may be a chance there is not enough sapce (return code 20 from EXECIO, system abend with B37). Is there a way to predict there will be enough space priror to issuing an EXECIO (e.g. using info. from listdsi function) ? By knowing there is not enougt sapce in advance, I could stop processsing the remaining rows and terminate the program.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Jun 15, 2010 10:04 am    Post subject: Reply with quote

A listdsi is only going to tell you about dasd.
what you want is an accurate count of data (rows) returned from your sql.
from there you could guesstimate your required allocation sizes.
(what I would do is have the sql to determine counts in a prior step
and then have the REXX script INPUT the counts
as well as a step for the utility to give you dasd stats,
which are only accurate at the time of gathering)

are your output files described via DD statements in your Jobstep?

if you allocated via REXX (removed the DD statements)
you could both
  • allocate at run time an adequate amount of space
  • if you encounter an out of space, you could just restart internally in your rexx


I normally encounter B37's when dealing with PDS's;
never on PS's when I use UNIT=SYSDA
are you dedicating a volser for these files?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Tue Jun 15, 2010 10:32 am    Post subject: Reply with quote

The accurate counts of rows from the SQL will not be able to provide an accurate estimate of dataset size because the number of records required for each row varies (e.g. from 0 to 20) depends on the data in the row. Yes, the output file is in the DD statement. When I first allocated the space of the dataset, it was the best estimate at the time.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Jun 15, 2010 10:34 am    Post subject: Reply with quote

danm,

Since this is a DB2 data extract , Ideally I would do this

1. First Run a Count(*) function to get the number of rows you would be extracting.
2. Based on the result from step 1 and the LRECL , I would calculate the space required as described here
http://www.mvsforums.com/helpboards/viewtopic.php?t=28
3. Allocate the Dataset with appropriate primary and secondary space

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Jun 15, 2010 10:50 am    Post subject: Reply with quote

if you allocated via REXX (removed the DD statements)
you could both

* allocate at run time an adequate amount of space
* if you encounter an out of space, you could just restart internally in your rexx by allocating more

you will have to do the first, since you persist on not knowing an allocation size -
simply 20 times applicable row count and use Kolusu's link to determine size.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
danm
Intermediate


Joined: 29 Jun 2004
Posts: 170
Topics: 73

PostPosted: Tue Jun 15, 2010 11:16 am    Post subject: Reply with quote

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group