Page 1 of 2

SELECT PGM

PostPosted: Wed Jun 13, 2018 9:28 pm
by samb01
Hello, it's the fisrt time i'm using "SELECT PGM" in a rexx but i can't anderstant the error (RC=8) juste after : "SELECT PGM(IEHLIST)"


10 *-* QUEUE COMMAND                                                
   >V>   " LISTVTOC VOL=3390=CVFTCD,DSNAME=MY.DATSA.VTOC"            
11 *-* "EXECIO 1 DISKW SYSIN (FINIS"                                
   >L>   "EXECIO 1 DISKW SYSIN (FINIS"                              
12 *-* /* "CALL 'SYS1.LINKLIB(IEHLIST)'" */                        
13 *-* X = OUTTRAP("ST.")                                          
   >L>   "ST."                                                      
   >F>   "ST."                                                      
14 *-* ADDRESS ISPEXEC                                              
15 *-* "SELECT PGM(IEHLIST)"                                        
   >L>   "SELECT PGM(IEHLIST)"                                      
   +++ RC(8) +++                                                    
16 *-* X = OUTTRAP("OFF")                                          
   >L>   "OFF"                                                      
   >F>   "OFF"                                                      
17 *-* ADDRESS TSO "FREE F(SYSIN)"                                  
   >L>   "FREE F(SYSIN)"                                            
18 *-* "EXECIO * DISKR SYSPRINT (FINIS"                            
   >L>   "EXECIO * DISKR SYSPRINT (FINIS"                          

 

Re: SELECT PGM

PostPosted: Wed Jun 13, 2018 9:53 pm
by enrico-sorichetti
the ispf manuals will be happy to tell the meaning of the 8 return code

Re: SELECT PGM

PostPosted: Thu Jun 14, 2018 2:31 am
by willy jensen
Any messages in SYSPRINT?

Re: SELECT PGM

PostPosted: Thu Jun 14, 2018 8:18 am
by steve-myers
There is probably a fatal flaw in the scheme. The VOL=3390=CVFTCD in the LISTVTOC statement does not imply IEHLIST will use dynamic allocation to allocate the volume. Rather, IEHLIST looks through the existing allocated DD statements to find a volume definition DD statement for the volume. See the DFSMS Utilities manual for more information. I see nothing in the little bit that was posted to indicate that any attempt was made to allocate the volume, so it is likely IEHLIST will fail. It does appear there was a CALL *(IEHLIST) statement that was removed, perhaps in the hope the SELECT PGM(IEHLIST) will do the trick.

Some years ago I wrote up an ALLOCVOL TSO command to allocate a volume. It's far too large to insert here, and I never thought of publishing it, as I believe running IEHLIST or the other "system" utilities in TSO is essentially useless. I did think LISTPDS might be useful, which was the impetus to write ALLOCVOL, but later I decided a more direct approach might be better.
listpds rbatch.load                                                  
 XXXXXX.RBATCH.LOAD ON XXXX31                                        
 -MEMBER- --TTRC-- ALIAS OF -SIZE- -----ATTRIBUTES----- AM  RM  AC SSI
 RBATCH   0000042C          0002C8 RN RU RF             24  24  00
 2 ALLOCATED DIRECTORY BLOCKS, 1 USED DIRECTORY BLOCKS
 READY
As you can see I stole the formatting from ISPF. This is more useful than this.
listpds rbatch.load du                                                
 XXXXXX.RBATCH.LOAD ON XXXX31
 -MEMBER- --TTRC-- --USER DATA (TTRC AND USER DATA ARE HEX)
 RBATCH   0000042C 0000090000 000000C2E3 0002C802C8 0000008800 01010000
 2 ALLOCATED DIRECTORY BLOCKS, 1 USED DIRECTORY BLOCKS
 READY

Re: SELECT PGM

PostPosted: Thu Jun 14, 2018 11:36 am
by expat
I usually use BPXWDYN to allocate a volume for LISTVTOC or VVDS processing

Re: SELECT PGM

PostPosted: Thu Jun 14, 2018 1:12 pm
by willy jensen
1. In general you should use "CALL *(pgm-name)" to run batch utilities from REXX.
2. BPXWDYN can be used to allocate a disk for IEHLIST.
Sample:
disk='XPAG01'                                                
 diskdd=''                                                    
 cc=bpxwdyn('alloc rtddn(diskdd) shr vol('disk') unit(sysda)')
 if cc<>0 then exit close('alloc disk failed' cc,8)            
 cc=bpxwdyn('alloc dd(sysin) new delete reuse',                
            'lrecl(80) recfm(f,b) blksize(0)',                
            'tracks space(1,1) unit(sysda)')                  
 if cc<>0 then exit close('alloc sysin failed' cc,8)          
 cc=bpxwdyn('alloc dd(sysprint) new delete reuse',            
            'lrecl(133) recfm(f,b) blksize(0)',                
            'tracks space(1,1) unit(sysda)')                  
 if cc<>0 then exit close('alloc sysprint failed' cc,8)        
 "delstack"                                                    
 queue ' LISTVTOC VOL=3390='disk                              
 "execio" queued() "diskw sysin (finis)"                      
 "call *(IEHLIST)"                                            
 say 'IEHLIST rc' rc                                          
 "execio * diskr sysprint (finis)"                            
 do queued()                                                  
   parse pull r                                                
   say r                                                      
 end                                                          
 exit close('Done')                                            
close:                                                        
 if arg(1)<>'' then say arg(1)                                
 zz=outtrap('zz.')                                            
 "free dd("diskdd "sysin sysprint)"                            
 zz=outtrap('off')                                            
 exit word(arg(2) 0,1)                                          

Re: SELECT PGM

PostPosted: Thu Jun 14, 2018 7:54 pm
by samb01
Thank you willy jensen , your example works !

I would never find it by myself.

I keep it.

Re: SELECT PGM

PostPosted: Thu Jul 19, 2018 5:55 pm
by samb01
Hello, i have a problem with : BPXWDYN
my input dataset have 7068 lines

in my rexx i do :


DO I = 1 TO DT.0                                                  
SAY 'COMPTAGE'I'/'DT.0                                            
  PARSE VAR DT.I DISK RESTE                                        
  DSN='SYS1.VTOCIX.'DISK                                          
 DISKDD=''                                                        
   CC=BPXWDYN('ALLOC RTDDN(DISKDD) SHR VOL('DISK') UNIT(SYSDA)')  
 IF CC<>0 THEN EXIT CLOSE('ALLOC DISK FAILED' CC,8)                
 CC=BPXWDYN('ALLOC DD(SYSIN) NEW DELETE REUSE',                    
            'LRECL(80) RECFM(F,B) BLKSIZE(0)',                    
            'TRACKS SPACE(1,1) UNIT(SYSDA)')                      
 IF CC<>0 THEN EXIT CLOSE('ALLOC SYSIN FAILED' CC,8)              
 CC=BPXWDYN('ALLOC DD(SYSPRINT) NEW DELETE REUSE',                
            'LRECL(133) RECFM(F,B) BLKSIZE(0)',                    
            'TRACKS SPACE(1,1) UNIT(SYSDA)')                      
etc..
 


but the rexx abend with this message ::


ALLOC DISK FAILED 72351744


so at the ligne : 1618
but i have : 7068 lines in my input dataset

Re: SELECT PGM

PostPosted: Thu Jul 19, 2018 6:08 pm
by Robert Sample
If you convert 72351744 to hex, you get 450 0000. And if you look in https://www.ibm.com/support/knowledgece ... 00/erc.htm you find that a 0450 means "Request caused the limit of concurrent allocations to be exceeded. (dsname allocation)". You need to deallocate data sets when you've finished with them as the TIOT establishes a fixed limit for the system, and you have exceeded that limit. Unless you start deallocating data sets, to process the rest of your 7068 lines will require you to partition the data set into smaller data sets so you don't exceed the TIOT limit and run each smaller data set separately (in a different batch job or different TSO session, however you are running the REXX).

Re: SELECT PGM

PostPosted: Thu Jul 19, 2018 6:21 pm
by willy jensen
The number of lines in the dataset has no influence on the dataset allocation.
As Robert Sample says, you should free datasets when no longer needed. Or if you really need a lot of concurrently allocated datasets, add 'DYNAMNBR=500' or some such number to the JCL.
Another hint, you should use the REUSE operand in BPXWDYN when you use fixed ddname.