-- ------------------------------------------------------------------ -- -- Reorg On Demand - Reorg Only When they are Needed -- -- DB2I2 Script to generate Online REORG JCL for Tabelspacs which -- -- Requires Reorg. -- -- Issue RXDB2I2 against the following Script to Generate Reorg JCL -- -- ------------------------------------------------------------------ -- -- DB2I2 Script to generate Online REORG JCL for Tabelspacs which -- -- Requires Reorg -- -- Host Variables: -- -- &dbname: DB name -- -- &parmutil_listts: LISTDEF Parm Utility Parms -- -- &listdef_o: LISTDEF Output for all TS Requires Reorg -- -- &parmutil_onlnrg: Online Reorg Parm Utility Parms -- -- &template_onlnrg: Online Reorg Template -- -- &mapping_table: Overriding Online Reorg Mapping table -- -- &reorg_o: REORG Output (*) -- -- &jobname: Jobname with # -- -- &jobno: Job start # - 1 -- -- ------------------------------------------------------------------ -- -- The following RXDB2I2 scripts generates DB2 Online Reorg JCL -- -- Use STATS command to decide if any TS or IX are required to REORG -- -- All required Reorg TS are then build into Listdef with LISTDEF -- -- The output from LISTDEF are stored in listdef(RNOP02) and be -- -- Used as input to Reorg. Use mapping_table override CM99.PC2XNJ11 -- -- to override the mapping table option in generated Online REorg -- -- JCL with predefined parmutil and template to generates -- -- DB2 Online Reorg JCL the output are stored in db2i2.genjcl -- -- with member name PC2XNJ##. Where ## starting from 11 -- -- ------------------------------------------------------------------ -- db2i2rex "RXDB2I2", "idsn=db2i2.script(onlnrg) ", "&dbname=DJOP02p", "&parmutil_listts='jrhj.parmutil(listts)'", "&listdef_o=listdef(RNOP02)", "&parmutil_onlnrg='jrhj.parmutil(reorgoln)'", "&template_onlnrg='jrhj.template(reorgoln)'", "&mapping_table=CM99.", "&reorg_o=db2i2.genjcl(*)", "&jobname=PC2XNJ##", "&jobno=10" -- ------------------------------------------------------------------ -- -- >>> copy the following lines thru ** End of Routine to -- -- >>> DB2I2.SCRIPT(ONLNRG) -- -- ------------------------------------------------------------------ -- -- DB2I2 Script to generate Online REORG JCL for Tabelspacs which -- -- Requires Reorg -- -- Host Variables: -- -- &dbname: DB name -- -- &parmutil_listts: LISTDEF Parm Utility Parms -- -- &listdef_o: LISTDEF Output for all TS Requires Reorg -- -- &parmutil_onlnrg: Online Reorg Parm Utility Parms -- -- &template_onlnrg: Online Reorg Template -- -- &mapping_table: Overriding Online Reorg Mapping table -- -- &jobname: Jobname with # -- -- &jobno: Job start # - 1 -- -- &reorg_o: REORG Output (*) -- -- ------------------------------------------------------------------ -- -- -- Use STATS command to get all TS and IX which require REORG -- LINEOBJ DDNAME=DD1 DB &dbname END_LINEOBJ DB2I2REX "STATS option=REORGTSIX idd=dd1 odsn=@JNM.w1" -- -- Use ED command to get TS line object only (Exclude all IX lines) -- LINEOBJ DDNAME=DD2 X all F 'TS' 1 all Del x all END_LINEOBJ DB2I2REX "ED @JNM.w1 MACRO(IDD=dd2)" -- -- Use LISTDEF command to generate LISTDEF for all TS line objects -- DB2I2REX "LISTDEF", "parmutil=&parmutil_listts", "idsn=@JNM.w1", "odsn=&listdef_o" -- -- Use REORG command to generate Online Reorg Jobs -- DB2I2REX "REORG ", "parmutil=&parmutil_onlnrg", "template=&template_onlnrg", "maptable=&mapping_table", "listdef=&listdef_o", "jobnm=&jobname", "job#=&jobno", "idd=dd1", "odsn=&reorg_o" -- *** End of Routine