REXX EXEC TO DETERMINE THE AVAILABLE STORAGE IN A TSO REGION

Document ID : KB000049090
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

This REXX Exec can be used to help determine the available storage based on TSO region size. This may be useful when an insufficient storage message is issued by one of the DB2 tools.

Solution:

Please place this in an EXEC library:

/* REXX                         */                                      
                                                                      
Numeric digits 10                                                       
                                                                      
ascb     = C2d(Storage(224,4))                                          
ascb     = C2d(Storage(224,4))                                          
ascb     = C2d(Storage(224,4))                                          
lda = C2d(Storage(D2x(ascb + 48),4))                                    
ldalimit = C2d(storage(D2x(lda + 208),4))                               
ldalimit = format(ldaLimit/(1024*1024),9,2)                             
ldaelim  = C2d(storage(D2x(lda + 216),4))                               
ldaelim  = format(ldaElim/(1024*1024),9,2)                              
                                                                      
Say ''                                                                  
say 'Below limit:' ldaLimit'M'                                          
Say 'Above limit:' ldaElim'M'                                           
                                                                      
Exit 0
 
Execute the REXX exec:
TSO EX 'highlvl.EXEC(VSTORUSE)'
 
Output example:
Below limit:         6.06M
Above limit:       192.00M
================================

JCL to execute the REXX EXEC in Batch, different region sizes can be supplied for J2 and J3:

//Jobcard
//TEST PROC                                                             
//S1  EXEC PGM=IRXJCL,PARM='VSTORUSE'                                   
//SYSTSIN  DD DUMMY                                                     
//SYSTSPRT DD SYSOUT=*                                                  
//SYSEXEC  DD DSN=hilvl.EXEC,DISP=SHR                          
// PEND                                                                 
//J1 EXEC TEST                                                          
//J2 EXEC TEST,REGION.S1=0M                                             
//J3 EXEC TEST,REGION.S1=400K                                           
//
 J1 will use the default region size.
 
Output Example:
Below limit:         7.98M
Above limit:      1111.00M
 
Below limit:         7.98M
Above limit:      1111.00M
 
Below limit:         7.98M
Above limit:      1111.00M

Note: If there is an IEFUSI exit in place this may determine the region limit. Also the above source may need to be adjusted depending on the z/OS version.