SELECT PGM



IBM's Command List programming language & Restructured Extended Executor

SELECT PGM

Postby samb01 » Wed Jun 13, 2018 9:28 pm

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"                          

 
samb01
 
Posts: 427
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SELECT PGM

Postby enrico-sorichetti » Wed Jun 13, 2018 9:53 pm

the ispf manuals will be happy to tell the meaning of the 8 return code
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: SELECT PGM

Postby willy jensen » Thu Jun 14, 2018 2:31 am

Any messages in SYSPRINT?
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: SELECT PGM

Postby steve-myers » Thu Jun 14, 2018 8:18 am

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
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: SELECT PGM

Postby expat » Thu Jun 14, 2018 11:36 am

I usually use BPXWDYN to allocate a volume for LISTVTOC or VVDS processing
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: SELECT PGM

Postby willy jensen » Thu Jun 14, 2018 1:12 pm

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)                                          
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Re: SELECT PGM

Postby samb01 » Thu Jun 14, 2018 7:54 pm

Thank you willy jensen , your example works !

I would never find it by myself.

I keep it.
samb01
 
Posts: 427
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SELECT PGM

Postby samb01 » Thu Jul 19, 2018 5:55 pm

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
samb01
 
Posts: 427
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: SELECT PGM

Postby Robert Sample » Thu Jul 19, 2018 6:08 pm

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).
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: SELECT PGM

Postby willy jensen » Thu Jul 19, 2018 6:21 pm

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.
willy jensen
 
Posts: 455
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 69 times

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post