Is there a utility to move all the Roscoe Members into a Dataset?

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

Question: 

Is there a utility to move all the Roscoe Members into a Dataset?

Answer: 

The rcoprpfx RPF will export a single user's Roscoe members from the ROSLIBS into a PDS. 

  • Save this file in your Roscoe RPF library.
  • To use this RPF:
    • Create a PDS specifying VB, LRECL 259 and BLKSIZ 27976
    • Make sure you specify enough directory members to accommodate all the members in the library.
    • To do a simple export, execute the RPF from the Roscoe command line:

RCOPRPFX PDSNAME (as defined above)

And it will fill up the PDS with the users members.

Read the instructions in the RPF for other options.

<<rcoprpfx>>                                                                    
: * ----------------------------------------------------------------- *         
: *                                                                   *         
: * argument variables:                                               *         
: *   a1 - data set name  (target) must exist                         *         
: *   a2 - user prefix                                                *         
: *   a3 - member name (blank for all, '*' or '+' for selection)      *         
: *                                                                   *         
: * processing variables                                              *         
: *   l8  - data set name                                             *         
: *   l9  - user prefix                                               *         
: *   l10 - mamber name                                               *         
: *   l11 - loop counter                                              *         
: *   l12 - extracted member name including prefix                    *         
: *   l13 - extracted member name                                     *         
: *   l14 - counter for exported members                              *         
: *   l15 - data set name with member name                            *         
: *                                                                   *         
: * Remarks:                                                          *         
: *   The target data set must be previously allocated                *         
: *   To avoid truncation of data when all members are exported,      *         
: *   the target data set should have                                 *         
: *   RECFM=VB,LRECL=259 and an appropriate block size (like 27976)   *         
: *                                                                   *         
: *   Existing members on target data set will be replaced            *         
: *                                                                   *         
: *   If user prefix is omitted, invoking user's prefix will be used  *         
: *                                                                   *         
: *   To process other user's library member, the invoking user       *         
: *   should have LIBADM authority or being authorized thru GROUPS    *         
: *   member definitions                                              *         
: *                                                                   *         
: *   Member selection may be either specified by:                    *         
: *      mask*                                                        *         
: *      mask+                                                        *         
: *      *mask+                                                       *         
: *                                                                   *         
: * ----------------------------------------------------------------- *         
: *                                                                   *         
push                                                                            
let l1 = s.attach                                                               
let l2 = s.monlevel                                                             
let l3 = s.msglevel                                                             
let l4 = s.awslb                                                                
let l5 = s.awsrb                                                                
let l6 = s.liblb                                                                
let l7 = s.librb                                                                
: * ----------------------------------------------------------------- *         
set attach nopause                                                              
set monlevel e                                                                  
set msglevel e                                                                  
set bounds aws 1 255                                                            
set bounds lib 1 255                                                            
<<start>>                                                           
cre aws rcop rpf                                                                
let l8  = upcase(a1)                                                            
let l9  = upcase(a2)                                                            
let l10 = upcase(a3)                                                            
: * ----------------------------------------------------------------- *         
: * validation of passed arguments                                    *         
: * ----------------------------------------------------------------- *         
 if conform(l8 'D') ne 1                                                        
    response 'RCOP001 - data set name invalid ' ! l8                            
    response 'RCOP999 - ' ! s.progname ! ' terminated with error'               
    return                                                                      
 endif                                                                          
 if l9  eq ''                                                                   
    let l9 = s.prefix                                                           
 endif                                                                          
 if length(l9) lt 2                                                             
    response 'RCOP002 - user prefix invalid ' ! l9                              
    response 'RCOP999 - ' ! s.progname ! ' terminated with error'               
    return                                                                      
 endif                                                                          
 if l10 eq ''                                                                   
    let l10 = '+'                                                               
 endif                                                                          
 if trt(l10 '*+') eq 0                                                          
    if conform(l10 'R') ne 1                                                    
       response 'RCOP003 - ROSLIB Member name invalid' ! l10                    
       response 'RCOP999 - ' ! s.progname ! ' terminated with error'            
       return                                                                   
    endif                                                                       
 endif                                                                          
: * ----------------------------------------------------------------- *         
trap on                                                                         
+a lib +l9+.+l10+                                                               
if s.tc ne 0                                                                    
   det lib                                                                      
   response s.lasterr                                                           
   response 'RCOP999 - ' ! s.progname ! ' terminated with error'                
   return                                                                       
endif                                                                           
c l r nohdr full to rcop                                                        
sel rcop                                                                        
r 1 1                                                                           
let l14 = 0                                                                     
: * ----------------------------------------------------------------- *         
loop l11 from 1 to l.memct                                                      
     set stmtcnt reset                                                          
     +read aws (rcop) +l11+ l12 4 12                                            
     let l13 = trim(substr(l12 length(l9) + 2))                                 
     let l15 = l8 ! '(' ! l13 ! ')'                                             
     trap on                                                                    
     +exp dsn=+l15+ inp=+l12+                                                   
     if s.tc ne 0                                                               
        response s.lasterr                                                      
        response 'RCOP000 - ' ! l14 ! ' members exported'                       
        response 'RCOP999 - ' ! s.progname ! ' terminated with error'           
        det lib                                                                 
        return                                                                  
     else                                                                       
        if s.rc ne 0                                                            
        response 'RCOP004 - EXPORT for member ' ! l13 !  -                      
                 ' failed, RC = ' ! s.rc                                        
        response 'RCOP000 - ' ! l14 ! ' members exported'                       
        response 'RCOP999 - ' ! s.progname ! ' terminated with error'           
        return                                                                  
        det lib                                                                 
        det dsn                                                                 
        else                                                                    
          let l14 = l14 + 1                                                     
        endif                                                                   
     endif                                                                      
endloop                                                                         
det lib                                                                         
det dsn                                                                         
response 'RCOP000 - ' ! l14 ! ' members exported'                               
response 'RCOP100 - ' ! s.progname ! ' successfully terminated'                 
return