You can use the LOAD statement to transform the contents of an Extract or Archive File to load utility format. You can then use the files created by this statement as input to a load utility to load the data into a database.
LOAD INPUT_FILE { ( USEDD ) | explicitfilename } CONTROL_FILE ( File Allocation Parameters ) TABLE_MAP mapid.name LOAD_DSNPRFX dsnprefix [ LOAD_BLKSIZE nnnnn ] [ LOAD_UNIT { SYSDA | unitname } ] [ LOAD_DSNTYPE {BASIC | LARGE | EXTREQ | EXTPREF} ] [ LOAD_VOLCOUNT {1 | nn} ] [ LOAD_PRIMARY n{ C | T | K | M } ] [ LOAD_SECONDARY n{ C | T | K | M } ] [ LOAD_MGMTCLASS mgmtclass ] [ LOAD_STORCLASS storclass ] [ CLEAR_ALL_TABLES { YES | NO } ] [ SORT_ROWS { YES | NO } ] [ KEEP_COLUMN_ORDER { YES | NO } ] [ AGING (parameters) ] [ REPORT_LEVEL { DETAIL | SUMMARY } ] [ FORCE_EXTERNAL_LOBS { YES | NO } ] [ ENFORCE_RI { YES | NO } ] [ EMPTY_TABLE_FOUND_RC4 { YES | NO } ]
When you specify this parameter, the Field Specification statements for all loaded tables and their associated data are stored in dynamically allocated data sets, which use the following naming convention.
dsnprefix.Lseq for Loader files
dsnprefix.Xseq for Field Specification files
where dsnprefix is the DSN prefix specified using this parameter, and seq is a sequential number assigned by the Optim solution.
For example, an entry of 25M would mean allocate 25 megabytes.
When LOB data is stored in a PDS/E data set, the Load utility input file (SYSREC) will not contain LOB data. Instead, the input file will contain reference pointers that point to the PDS/E data set and member name in which each instance of LOB data is stored.
Storing LOB data in a PDS/E data set reduces the length of table rows in the input file. It also allows the Load utility to load table rows that would otherwise be too long to load. Specify:
Use the following statement to transform the contents of the DEPT14.TRADES file to Load utility format, using the DEPT14.TRADESMAP table map.
LOAD INPUT_FILE DEPT14.TRADES CONTROL_FILE (DSNAME DEPT14.CTRLFILE MODE REP) TABLE_MAP DEPT14.TRADESMAP LOAD_DSNPRFX PSTJS.LOADOUT
You must include the appropriate DD statements for the load utility program you are using. See the documentation for the program for information about the required DD statements.
If you do not specify the LOAD_DSNPRFX keyword in the LOAD batch utility, you must include a PSDFLnnn DD statement for each table space into which you are loading data. For example,
//PSDFL001 DD DSN=PSTJS.SUPDB.PSTJS.STEP001, // DCB=(DSORG=PS,RECFM=VB,LRECL=23472,BLKSIZE=0), // DISP=(MOD,CATLG,CATLG), // UNIT=SYSDA, // SPACE=(0,1,1),RLSE,,ROUND)
Also, for each table space into which you are loading data, you must include the following statements in the load utility JCL:
//SYSREC DD DSN=dsnprefix.Lseq,DISP=OLD //SYSIN DD DSN=load.data.ds,DISP=OLD // DD DSN=dsnprefix.Xseq,DISP=OLD
The LOAD batch utility statement generates the dsnprefix.Lseq (Loader) and dsnprefix.Xseq (Field Specification) output files. For example, the following LOAD output summary lists the Loader and Field Specification output files:
CONVERSION OF ARCHIVE OR EXTRACT FILES IS COMPLETE. SUMMARY OF RESULTS BY TABLE SPACE: TABLE SPACE PSTJS LOAD OUTPUT FILE (PSDFL001): PSTJS.LOADOUT.L001 FIELD-SPEC FILE (PSDFX001): PSTJS.LOADOUT.X001
The load.data.ds data set contains the control statement for the load utility you are using. For example, the DB2® LOAD control statement includes the following keywords:
LOAD DATA REPLACE LOG YES SORTKEYS 0 ENFORCE NO DISCARDS 0
By comparison, if you were to use the online screens, Optim would generate the following DB2 LOAD control statements:
//DSNUPROC.SYSIN DD * LOAD DATA REPLACE LOG YES SORTKEYS 0 ENFORCE NO DISCARDS 0 CONTINUEIF(1:1)=X'FF' INTO TABLE PSTDEMO.SALES WHEN (1:2) = X'0001' (SALESMAN_ID POSITION (3:8) CHAR, SALESMAN_NAME POSITION (9:28) CHAR, AGE POSITION (29:32) INTEGER, SEX POSITION (33:33) CHAR, TERRITORY POSITION (34) VARCHAR, MANAGER_ID POSITION (52:57) CHAR NULLIF (50:50) = X'FF')
Large Object (LOB) data from the archive or extract file must be stored either inline in the Load Process input file (SYSREC) or externally in a Partitioned Data Set - Extended (PDS/E) data set. Do not change the generated JCL to store LOB data in a Partitioned Data Set (PDS) data set. Also, ensure that the PDS/E data set used in the generated JCL is empty. If the PDS/E data set is not empty, the members created in this step might replace members in the existing data set.