-- ------------------------------------------------------------------ -- -- Automatically Build/Run DSCOPY from One location to Another -- -- ------------------------------------------------------------------ -- -- DB2I2 Script to generate DSCOPY from one Location to Another Loc -- -- Host Variables: -- -- &source_db: Source DBname -- -- &source_ts: Source TSname SQL statement -- -- &target_db: Target DBname -- -- &source_ssid: Source SSID -- -- &source_location: Source Location -- -- &target_location: Target Location -- -- &rebuild_ix: Rebuild Index Parm RCVRIX=Y or RCVRIX=N -- -- &icdate: ICDATE Parameter ICDATE=YYMMDD -- -- &icgen: ICGEN Parameter # -- -- &output: DSN1COPY JCL Output -- -- ------------------------------------------------------------------ -- -- The following RXDB2I2 script generates DSN1COPY and Rebuild Index -- -- JCL from Database DJOP01P in location JRHLOC1 -- -- To Database DJOP01V in location JRHLOC2 -- -- Using image copies created on 03/30/2009 -- -- with High Level Qualifier HH -- -- and Save the output JCL in T1 -- -- ------------------------------------------------------------------ -- LINEOBJ ddname=LINEOBJ dummy END_LINEOBJ db2i2rex "RXDB2I2", "idsn=db2i2.script(dscopyg) ", "&source_db=DJOP01P", "&source_ts=TSNAME IN ('SN3B022','SN3B017')", -- "&source_ts=TSNAME BETWEEN 'SN1D001' AND 'SN1D006'", "&target_db=DJOP01V", "&ssid=SSTR", "&source_location=JRHLOC1", "&target_location=JRHLOC2", "&rebuild_ix=RCVRIX=Y", "&hlq=HH", "&icdate=ICDATE=090330", "&icgen=0", "&output=t1" -- ------------------------------------------------------------------ -- -- >>> copy the following lines thru ** End of Routine to -- -- >>> DB2I2.SCRITP(DSCOPYG) -- -- ------------------------------------------------------------------ -- -- DB2I2 Script to generate DSCOPY from one Location to Another Loc -- -- Host Variables: -- -- &source_db: Source DBname -- -- &source_ts: Source TS SQL statement -- -- &target_db: Target DBname -- -- &ssid: Current SSID -- -- &source_location: Source Location -- -- &target_location: Source Location -- -- &hlq: High Level Qualifier Image Copy dataset -- -- &rebuild_ix: Rebuild Index Parameter -- -- &icdate: ICDATE Parameter -- -- &icgen: ICDATE Parameter -- -- &output: RUN output -- -- ------------------------------------------------------------------ -- -- -- RUN -- LINEOBJ ddname=dd1 SELECT 'SC &ssid\&source_location.'|| '&source_db.'||strip(TSNAME)|| ' &ssid\&target_location.'|| '&target_db.'||strip(TSNAME), CASE WHEN PARTITION = 0 THEN ' ' ELSE DIGITS(PARTITION) END CASE, '&rebuild_ix', '&icdate', '&icgen' FROM SYSIBM.SYSTABLEPART WHERE DBNAME like '&source_db%' AND &source_ts ORDER BY 1,2 END_LINEOBJ db2i2rex "RUN", "idd=dd1", "T=N", "odsn=@JNM.w1" LINEOBJ ddname=dd2 -- ------------------------------------------------------------------ -- -- Post processing after DSN1COPY jobs are Created -- -- Find all DSN=HH lines and Add a line after it -- -- ------------------------------------------------------------------ -- F 'DSN=HH' First LOOP InsertA * // LABEL=EXPDT=98000, F 'DSN=HH' Next LOOP_END END_LINEOBJ db2i2rex "DSCOPY ", "CONT=Y", "hlq=&hlq", "idsn=@JNM.w1", "odsn=&output", "macro(idd=dd2)" -- *** End of Routine