-- ------------------------------------------------------------------ -- -- The following RXDB2I2 script: -- -- Use MIGR command to Copy a TS structure -- -- from source location to target location and -- -- Use DSCOPY command to generate DSN1COPY JCL -- -- to copy data from source image copy to target location -- -- ------------------------------------------------------------------ -- -- Connect to Source location -- -- ------------------------------------------------------------------ -- db2i2rex "CONNECT(JRHLOC1)" -- ------------------------------------------------------------------ -- -- Use MIGR to generate Migration DDL, DCL.. -- -- ------------------------------------------------------------------ -- LINEOBJ ddname=LINEOBJ ts mydb.myts END_LINEOBJ db2i2rex "MIGR", "SQLID=DB2ADMIN", "SQLTERM(;)", -- "OBID", -- "MAXASGN", -- "%=100 CYL ALLOC=(CYL,500,500)", "VOL=*", -- ------------------------------------------------------------------ -- -- Migration Option: -- -- ================= -- -- VW=Y View AL=Y Alias SY=Y Synonyms -- -- BIND=Y Bind GRANT=Y Grant DT=Y Distinct DataType -- -- LO=Y Large Obj FU=Y Function SQ=Y Sequence -- -- MT=Y|N|S S-include Table Space Material Query Table -- -- RI=B|P|C|N B-Both P-Parent C-Child N-No Referencial Integrity -- -- ------------------------------------------------------------------ -- "VW=Y", "AL=Y", "SY=Y", "BIND=Y", "GRANT=Y", "DT=Y", "LO=Y", "FU=Y", "TR=Y", "SQ=Y", "MT=Y", "RI=B", -- ------------------------------------------------------------------ -- -- Migration Override: -- -- CL=new-collID-name CRE=new-creator-name DB=new-db-name -- -- O=new-owner-name Q=new-qualifier-name SG=new-stogroup-name -- -- SH=new-schema-name VCAT=new-VCAT-name -- -- ------------------------------------------------------------------ -- "CL=JRH1", "CRE=JRH1", "DB=mydb1", "O=JRH1", "Q=JRH1", "SG=mysg1", "SH=JRH1", "VCAT=JRH1", -- ------------------------------------------------------------------ -- -- Migration Output: -- -- ODSN: output dataset -- -- WKSP=(C|T,pri,sec) Output file allocation C-Cylinder T-Track -- -- pri, sec are primary and secondary allocation-- -- ------------------------------------------------------------------ -- "ODSN=t1", "WKSP=(C,20,20)" -- ------------------------------------------------------------------ -- -- Reset connection to local -- -- ------------------------------------------------------------------ -- db2i2rex "CONNECT(RESET)" -- ------------------------------------------------------------------ -- -- Execute the Generated DDL use the output from previous MIGR command-- -- ------------------------------------------------------------------ -- db2i2rex "EXEC IDSN=t1" -- ------------------------------------------------------------------ -- -- Use DSCOPY command to generate DSN1COPY and Rebuild index JCL -- -- ------------------------------------------------------------------ -- -- DD1 Contains SC line -- -- ------------------------------------------------------------------ -- LINEOBJ ddname=DD1 SC JRH\JRHLOC1.mydb.myts mydb1.myts END_LINEOBJ -- ------------------------------------------------------------------ -- -- DD2 contains post Edit Macro to Insert a line after each DSN=HH line- -- ------------------------------------------------------------------ -- LINEOBJ ddname=DD2 F 'DSN=HH' First LOOP InsertA * // LABEL=EXPDT=98000, F 'DSN=HH' Next LOOP_END END_LINEOBJ -- ------------------------------------------------------------------ -- -- Use most current HH high qualifier image copy as SYSUT1 Input -- -- ------------------------------------------------------------------ -- db2i2rex "DSCOPY ", "hlq=HH", -- "ICDATE=yymmdd", "idd=DD1", "odsn=t2", "macro(idd=DD2)" -- ------------------------------------------------------------------ -- -- ** End Of Routine ** -- -- ------------------------------------------------------------------ --