You can do this with ISPF in batch, and Rexx.   I've used this when I had to 
change the one thing in hundreds of PDS members.  Of course you have to balance 
your development and debugging time versus just doing repetitive edits via 
RCHANGE (PF6).... 


To invoke ISPF in batch.  Note BDISPMAX very large to prevent failures from 
exceeding an ISPF message limit

//IKJEFT01 EXEC PGM=IKJEFT01                                
//SYSEXEC  DD DISP=SHR,DSN=your.exec.library.with.the.exec   
//ISPPLIB  DD DISP=SHR,DSN=ISP.SISPPENU                     
//ISPMLIB  DD DISP=SHR,DSN=ISP.SISPMENU                     
//ISPSLIB  DD DISP=SHR,DSN=ISP.SISPSENU                     
//ISPTLIB  DD DISP=SHR,DSN=ISP.SISPTENU                     
//ISPPROF  DD DISP=SHR,DSN=your.ISPF.profile.library       
//SYSTSPRT DD SYSOUT=(,)                                    
//SYSTSIN  DD *                                             
 ISPSTART BDISPMAX(99999) -                                 
 CMD(%Rexx_exec dataset_name  variable_value)

This is the Rexx I used with some changes to protect the innocent..

/* REXX */
/* This is the exec named Rexx_exec in the batch job */                         
                            
/* This exec will invoke ISPF EDIT with a macro for each member */ 
/* of a PDS                                                                     
               */ 
PARSE ARG DSN  variable                                                         
                                     
ADDRESS ISPEXEC         
/* variable comes in at invocation, must VPUT to use it in the edit macro.  If 
you don't need to pass a variable you can eliminate this */                     
                       
"ISPEXEC VPUT variable SHARED"                                       
"ISPEXEC LMINIT DATAID(DATA1),                                       
         DATASET('"DSN"') ENQ(EXCLU)"                                           
                                       /* sets the DATAID for the PDS passed in 
DSN */                             
"ISPEXEC LMOPEN DATAID("DATA1") OPTION(INPUT)"                                  
                       /* OPEN FOR INPUT */ 
EDITRC = 0                                                         
LMRC = RC                                                          
DO WHILE LMRC = 0 & EDITRC < 8                                                  
                                    /* BUILD MEMBER  LIST  unless an error      
   */      
  "ISPEXEC LMMLIST DATAID("DATA1")                                    
     OPTION(LIST) MEMBER(MEMBER)                                      
     STATS(NO)"                                                                 
                                                    
   LMRC = RC                                                                    
                                                    /* CAPTURE RETURN CODE  */  
    
   IF LMRC = 0  THEN                                                            
                                                /* IF A MEMBER NAME         */  
    
     DO                                                                         
                                                          /* RETURNED OK        
         */      
       SAY 'PROCESSING MEMBER' MEMBER 'OF MASTER AT' TIME()           
       "ISPEXEC EDIT DATAID("DATA1") MEMBER("MEMBER") MACRO(edit_macro_name)"   
    /* edit the member  using edit macro */
       EDITRC = RC                                                              
                                                    /* return code from edit    
  */  
     END                                                              
END                                                                   
"ISPEXEC LMMLIST DATAID("DATA1") OPTION(FREE)"                                  
                          /* FREE DATA LIST */ 
"ISPEXEC LMCLOSE DATAID("DATA1")"                                               
                                   /* CLOSE DATASET related to DATAID */        
   
"ISPEXEC LMFREE DATAID(DATA1)"                                                  
                                     /*  Free the DATAID  */


Skeleton of the edit macro

ADDRESS ISPEXEC                                             
"ISPEXEC VGET variable SHARED"                                
variable = "'"||variable||"'"                                                   
                                               /* had to add single quotes for 
some reason */
                                                                                
                                                            /*  may not be 
needed                                   */                     
"ISREDIT MACRO"                                             
"ISREDIT (CURDSN,,) = DATASET"                              
"ISREDIT (CURMEM) = MEMBER"                                 
IF MEMBER = ' '                                                                 
                                                   /* Created these to use in 
any error messages */                                       
THEN                                                                            
                                                        /* produced by the edit 
macro                           */                                          
   DO                                                       
     ERRLOC = ' IN DATASET '||CURDSN                        
   END                                                      
ELSE                                                        
   DO                                                       
     ERRLOC = ' IN MEMBER '||CURMEM||' OF DATASET '||CURDSN 
   END                                                      
------- your EDIT macro stuff goes here ------------------
ISREDIT END                                                              

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to