How to mass change the DDNAME defined in the Schedule Base Record and Job Base Record
search cancel

How to mass change the DDNAME defined in the Schedule Base Record and Job Base Record

book

Article ID: 199956

calendar_today

Updated On:

Products

Scheduler Job Management

Issue/Introduction

Objective: Change DDname 'TESTLIB' to 'TESTLIBX' from all the schedule and job base records. 

Resolution

1. Identify which schedules and jobs have DDname=TESTLIB.  There are 2 options:

a. Run "UNLOAD Schedule Name=*,DDname=output", and search for DDname='TESTLIB' in the output file.

b. Run an EARL report to list all the jobname or schedulename that has DDname='TESTLIB'.  Note: Common Services PTF SO12102 must be applied else the Scheduler EARL report does not work.

2. To change the DDname on the schedule base record in batch mode, use command ALTER SBR. 

    To change the DDname on the job base record, use command ALTER JBR.  

    To mass change the SBR/JBR, we recommend using the UNLOAD output file.   Here's how:  

a.  Edit the UNLOAD output file, and search for DDNAME='TESTLIB'.

b.  Confirm that this is the schedule or job that needs to have the DDNAME changed. 

c.  Change the DDNAME to the new value.   DDNAME='NULL' means that the DDname field is blank.

d.  Change command DEFINE to ALTER.  Ex: change DEFINE SBR NAME='payroll' to ALTER SBR NAME='payroll'. 

e.  You may remove all parameters, and keep only DDNAME as that's the only field that needs to be altered. 

Example:   

ALTER  SBR NAME='PAYROLL',         
DDNAME='NULL'                      
ALTER  JBR NAME='JOBA',S=PAYROLL,  
DDNAME='TESTLIBX'                   

The above commands set the DDname of schedule 'payroll' to blank, and set DDname of joba to 'TESTLIBX'.  

f.  Remove all other DEFINE commands because they are not needed.  (Only the SBR and JBR have DDNAME.) 

g. Run CAJUTIL0 job with SYSIN pointing to the updated unload file. 

Additional Information

- Sample UNLOAD job:

//STEP1   EXEC CAJUTIL0                                                         
//OUTPUT DD  DISP=(,CATLG,DELETE),                                              
//        DCB=(RECFM=FB,LRECL=80,BLKSIZE=3120),                                 
//        UNIT=SYSDA,SPACE=(CYL,(10,5),RLSE),                                    
//        DSN=HLQ.UNLOAD.DATA                                                               
//SYSIN DD *                                                                    
UNLOAD SCH N=*,DD=OUTPUT,INC=YES,SEPLINE=YES                                    
/*

- Sample CA-EARL job to display all jobs with DDname = 'TESTLIB':  

//EARL     EXEC CAICHERL                                                        
//CAICHREP.CAIJHST DD DUMMY                                                     
//SYSIN DD *                                                                    
OPTION PRINTER=132                                                              
OPTION CPAGE=56                                                                 
OPTION LIST OFF                                                                 
CAIJMST:FILE CAJCACC2 RECORD = 2048                                             
COPY CAJEJM                                                                     
! THIS IS A COMMENT STATEMENT                                                   
! CAJEJM IS JOB INFORMATION LAYOUT                                                 
! CAJEJM IS IN CAIEARL LIBRARY                                                  
COPY CAJEPM                                                                     
SET PRMFUNC = 'GETS'                                                            
SET PRMID = 'JOB '                                                              
GET CAIJMST                                                                     
GOTO EOJ CAIJMST = 'E' OR CAIJMST = 'N'                                         
REPORT 'JOB DDNAME REPORT'                                                      
! SELECT  ALL JOBS:                                                            
! SELECT  JOBRECID = 'J'  
! SELECT ONLY JOBS THAT HAVE DDNAME TESTLIB:                                                      
SELECT  JOBDDNAME = 'TESTLIB'                                                     
PRINT JOBNAME JOBNUMBER JOBSCHNAME JOBDDNAME                                    
END                                                                             
//                                                                              

- Sample CA-EARL job to display all schedules with DDname = 'TESTLIB': 

//EARL     EXEC CAICHERL                        
//CAICHREP.CAIJHST DD DUMMY                     
//SYSIN DD *                                    
OPTION PRINTER=132                              
OPTION CPAGE=56                                 
OPTION LIST OFF                                 
CAIJMST:FILE CAJCACC2 RECORD = 2048             
! THIS IS A COMMENT STATEMENT                   
! CAJESM IS SCHEDULE INFO LAYOUT                        
! CAJESM IS IN CAIEARL LIBRARY                  
COPY CAJESM                                     
COPY CAJEPM                                     
SET PRMFUNC = 'GETS'                            
SET PRMID = 'SCH '                              
GOTO EOJ CAIJMST = 'E' OR CAIJMST = 'N'         
REPORT 'SCHEDULE DDNAME REPORT'                 
! SELECT ALL  SCHEDULES:                        
! SELECT SCHRECID = 'S'    
! SELECT ONLY SCHEDULES THAT HAVE DDNAME 'TESTLIB':                      
SELECT SCHDDNAME = 'TESTLIB'                    
PRINT SCHNAME SCHDDNAME                         
END                                             
//