File Manger batch job to add a line of JCL in PDS members



Ask queries about other IBM Tools like Tivoli, COBTEST, Fault Analyzer, z/OS File Manager, Workload Simulator, APA, SCLM, Merge & Migration Tools etc...

File Manger batch job to add a line of JCL in PDS members

Postby tripmush » Fri Apr 07, 2017 10:20 pm

Hi all! Looking for some help with a batch File Manager job to delete a line from JCL in a PDS. I am not very familiar with File Manager, but have some old jobs that I inherited and have been attempting to modify – for example, I have a job that will delete a line for PDS members:
//STEP01  EXEC PGM=FMNMAIN                                  
//SYSUDUMP DD SYSOUT=*                                      
//SYSPRINT DD SYSOUT=*                                      
//SYSLIST  DD SYSOUT=*                                      
//SYSTOTAL DD SYSOUT=*                                      
//DDIN     DD DISP=SHR,DSN=CICSESA.CICS.TEST          
//DDOUT    DD DISP=SHR,DSN=CICSESA.CICS.TEST.AFTER    
//SYSIN    DD *                                            
$$FILEM DSC ,                                              
$$FILEM MEMBER=*,REPLACE=YES,PROC=*                        
*FASTREXX                                                  
IF FLD_CO(,,,'CCRCLR=') THEN                                
   RETURN 'DROP'                                            
/*                                                          
//*                                                        
 

So what I am looking for is a batch File Manager job that will ADD a line of JCL after it find another specific line, in all members in a PDS. For example, if it finds 'ENV=TEST,', then I would like it to insert a line like '// OMEG=YES,'. If someone can provide an example, that would be great!
tripmush
 
Posts: 3
Joined: Fri Apr 07, 2017 8:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File Manger batch job to add a line of JCL in PDS members

 

Re: File Manger batch job to add a line of JCL in PDS member

Postby tripmush » Fri Apr 21, 2017 2:43 am

WE figured it out - the SYSIN would be something like this:
$$FILEM DSC ,                                              
$$FILEM MEMBER=*,REPLACE=YES,PROC=*                        
 IF FLD(11,5) = 'CSMNT'                                    
   THEN DO;                                                
     WRITE()      /* WRITE ORIGINAL RECORD */              
     OUTREC='//        CCRCLR=WHITE        CAFC RGN COLOR',
            '                                    '          
     WRITE()      /* WRITE NEW RECORD */                    
     RETURN DROP                                            
   END;
tripmush
 
Posts: 3
Joined: Fri Apr 07, 2017 8:31 pm
Has thanked: 0 time
Been thanked: 0 time

Re: File Manger batch job to add a line of JCL in PDS member

Postby NicC » Fri Apr 21, 2017 3:46 pm

Good to know you got it resolved and thanks for sharing.

When posting code please use the code tags. I have coded your posts for you. If you do not know how to use the code tags then use the POSTREPLY button instead of the Quick Reply button.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2664
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 100 times

Re: File Manger batch job to add a line of JCL in PDS member

Postby tripmush » Fri Apr 21, 2017 6:12 pm

Thanks NicC!
tripmush
 
Posts: 3
Joined: Fri Apr 07, 2017 8:31 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Other IBM Tools

 


  • Related topics
    Replies
    Views
    Last post