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

Re: SELECT PGM

 

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: 2702
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 139 times

Re: SELECT PGM

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

Any messages in SYSPRINT?
willy jensen
 
Posts: 149
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 23 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: 1917
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 206 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: 402
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 4 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: 149
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 23 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: 263
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post