Creating a version using CM batch

You can use Db2® Admin Tool change management batch mode to create a version when running a change.

Procedure

  1. Modify the JCL template, setting parameters as appropriate for the type of version that you require.

    Specify the appropriate information in the generate_base_version_before_run and generate_base_version_after_run lines:

    • AUTO or USER in the generate_base_version_before_run line to generate a new base version immediately before the change is implemented.
    • AUTO or USER in the generate_base_version_after_run line to generate a new base version immediately after the change is implemented.

    The following JCL example imports a change, analyzes the change, and runs the change. A base version is created before and after the change is run. The base versions will be associated with the change.

    //BASEVF   JOB (DBA123,ICE,ICE,ICE),'SAMPLE',CLASS=B,  
    //   MSGCLASS=H,MSGLEVEL=(1,1),NOTIFY=DBA123,TIME=(,30),       
    //   REGION=0M                                                  
    //*                                                             
    /*JOBPARM S=SY4A                                                
    //*                                                             
    //LSCLIBS JCLLIB ORDER=ADB.DEVCUST.SAMP                         
    //*                                                             
    //GOCCM    EXEC GOCCM,SSID=DSNA,PLAN=ADB                     
    //GOCCM.PARMS DD *  
      change_name = 'S22957'
      ACTION_RUN_CHANGE = 'Y'           
      generate_base_version_before_run = 'auto'
      generate_base_version_after_run = 'auto'      
    /*                                             
    //IMCHG001  DD *
    --
      ALTER TABLE SCH123.EMP
        ADD COLUMN NEWCOL INT NOT NULL WITH DEFAULT;
    /*
  2. Run the JCL.