The HCOSS Extract Schema tool, when used as an online tool, requires a direct connection to DB2 for z/OS. In some production environments, this direct access can have a negative effect on the speed of regular business transactions on production databases, or can sometimes upset database security policy. To get around this, we provide a solution for schema extraction that can be done off line.
You can use Mainframe Batch Database Tools (MBDT) along with z/OS DB2 DSNUTILB UNLOAD to eliminate the need for direct access to the z/OS DB2 catalog. With this approach, the contents of the DB2 tables are unloaded from the mainframe using methods that either minimize or have no effect on z/OS DB2 processing. Once DB2 catalog tables are unloaded, you can use MBDT to load this information into SQL Server. This enables the Extract Schema tool to access the catalog via SQL Server.
This offline Extract Schema approach expands the existing HCOSS Toolset by altering only the Extract Schema step in the process of HCOSS database migration. All other steps, from Assess Data Migration to Compare Data, remain unchanged.
Like the online Extract Schema tool, the HCOSS Offline Extract Schema tool supports multiple versions of DB2 for z/OS, starting with Version 9.
Unlike the online Extract Schema tool, which is one-step process, the offline tool requires that you perform multiple steps:
The following sections provide details for each step:
The SYSIBM schema contains 17 DB2 catalog tables that must be unloaded. To expedite this, Micro Focus provides the UNLOAD.parm file that contains all recommended UNLOAD cards. While some of the UNLOAD cards in UNLOAD.parm select an entire table, some of them select only a subset of the columns of a particular table. For example:
UNLOAD EBCDIC CCSID(00037,00037,00000) DATA FROM TABLE SYSIBM.SYSPARMS ( SCHEMA, NAME, PARMNAME, ROWTYPE, ORDINAL, TYPENAME, LENGTH, SCALE, SUBTYPE, CCSID, ENCODING_SCHEME)
The purpose of selecting a subset of columns for some tables is to reduce the amount of data to unload, yet still provide enough information for the HCOSS Extract Schema tool to work successfully.
MFDAS IMPORT enables you to both copy and catalog all in one step, but you must run the tool separately for each extracted table. Therefore, you might consider creating a single batch file containing an MFDAS IMPORT command for each table.
At your Enterprise Server command prompt, run MFDAS IMPORT using the following syntax:
MFDAS IMPORT datFilePath\datFileName.dat FROM QSAM mainframeDataSet /CATLOC=ESWorkArea\ESRegionName\catalog.dat
Where the variables are:
For example, to copy and catalog the data set for SYSVIEWS, the command line might look like this:
MFDAS IMPORT C:\work\DB2CATALOG\SYSVIEWS.DAT FROM QSAM MFIXCH.UTILBTS.ULSYSVWS
/CATLOC=%USERPROFILE%\Documents\Micro Focus User\Enterprise Developer\WORKAREAEXSCHEMA\catalog.dat
We recommended that you execute CREATECATALOG.sql from SQL Server Management Studio. Before execution, be sure that the SYSIBM schema exists in the SQL Server database.
The following is a JCL example of MBDT DSNUTILB LOAD into a table in SQL Server:
//LDSYSPRM JOB //DSNUPROC EXEC PGM=TSTUTILB,PARM='HCOD,SH ' //* //SYSPRINT DD SYSOUT=* //UTPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //STPRIN01 DD SYSOUT=* //*COLSDISC DD SYSOUT=* //* DISCARDDN CHKSDISC DISCARDS 0 //IDIOFF DD DUMMY //* //SYSUT1 DD DISP=MOD,DSN=SH.DSNUTILB.SYSUT1 //SORTOUT DD DISP=MOD,DSN=SH.DSNUTILB.SYSOUT //SYSMAP DD DISP=MOD,DSN=SH.DSNUTILB.SYSMAP //SYSERR DD DISP=MOD,DSN=SH.DSNUTILB.SYSERR //SYSREC DD DISP=SHR,DSN=MFIXCH.UTILBTS.ULSYSPRM //SYSIN DD * LOAD DATA INDDN SYSREC LOG NO REPLACE YES EBCDIC CCSID(00037,00037,65534) INTO TABLE "SYSIBM". "SYSPARMS" WHEN(00001:00002) = X'0146' NUMRECS 1274 ( "SCHEMA" POSITION( 00003:00132) VARCHAR , "NAME" POSITION( 00133:00262) VARCHAR , "PARMNAME" POSITION( 00263:00392) VARCHAR , "ROWTYPE" POSITION( 00393:00393) CHAR(001) , "ORDINAL" POSITION( 00394:00395) SMALLINT , "TYPENAME" POSITION( 00396:00525) VARCHAR , "LENGTH" POSITION( 00526:00529) INTEGER , "SCALE" POSITION( 00530:00531) SMALLINT , "SUBTYPE" POSITION( 00532:00532) CHAR(001) , "CCSID" POSITION( 00533:00536) INTEGER , "ENCODING_SCHEME" POSITION( 00537:00537) CHAR(001) ) /* // //*
MFExtractSchemaInfo DB2=HCODEMO; OUT=SCH81010; SCHEMA=DSN81010; TYPELOG=FILE
For complete information on running the Extract Schema tool from the command line, see MFExtractSchemaInfo command.
This turns off the Table Row Count and Both Estimate and Actual options. If the actual table row count is required, use the UI version of the Assess Data Migration tool.