LOAD

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 } ]
INPUT_FILE
Identify the name of the extract or archive file you want to use in the LOAD process. Specify:
USEDD
Use the file name specified in the PSDFEXTR control card statement.
explicitfilename
The fully qualified name of the extract or archive file.
CONTROL_FILE
Identify the control file you want to use in the LOAD process. Use the keywords shown in File Allocation Parameters to name and allocate the control file.
TABLE_MAP
Identify the name of the table map you want to use. TABLE_MAP is required.
mapid.name
The fully qualified name of the table map.
LOAD_DSNPRFX
If appropriate, type the data set name prefix for all Loader and Field Specification files generated by the LOAD statement. The specified prefix can consist of up to 35 characters and must follow standard data set naming conventions. This parameter allows the Optim™ solution to create the required Field Specification files dynamically during Load preparation step execution, instead of statically during JCL generation.

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
Specify a prefix up to 35 characters, using standard data set naming conventions. The LOAD statement names the output files as follows:

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.

LOAD_BLKSIZE
Specify the block size for allocating Loader files. The default value is 23476.
nnnnn
Specify a block size from 5000 to 32767.
LOAD_UNIT
Specify the unit type for allocating Loader files. The default value is SYSDA.
unitname
Specify a site-defined unit type.
LOAD_DSNTYPE
Specify the data set name type, as defined by the Data Facility Storage Management Subsystem (DFSMS) allocation documentation. The Optim solution supports both extended and large sequential data sets for the loader data set. Specify:
BASIC
An extended or large format sequential data set need not be allocated (default).
LARGE
A large format sequential data set is to be allocated.
EXTREQ
An extended data set is required.
EXTPREF
An extended data set is preferred.
LOAD_VOLCOUNT
Specify the number of volumes that can be assigned to the file. The default on the panel is 1. If the default value is deleted and not replaced, the volume count for the input data set is used. If needed, the Optim solution will automatically increase the specified volume count, up to the maximum value allowed by DFSMS.
LOAD_PRIMARY
Specify the primary quantity of space you want allocated in a given space unit. If omitted, a default space allocation is calculated. Specify:
n
The space to allocate. Specify any integer up to the maximum value allowed by DFSMS for the selected space unit.
C, T, K, or M
The primary space unit for allocation purposes must be one of the following:
  • C for cylinders
  • T for tracks
  • K for kilobytes
  • M for megabytes

For example, an entry of 25M would mean allocate 25 megabytes.

LOAD_SECONDARY
Specify the secondary quantity of space you want allocated in a given space unit. If omitted, a default space allocation is calculated. Specify:
n
The space to allocate. Specify any integer up to the maximum value allowed by DFSMS for the selected space unit.
C, T, K, or M
The secondary space unit for allocation purposes must be one of the following:
  • C for cylinders
  • T for tracks
  • K for kilobytes
  • M for megabytes
LOAD_MGMTCLASS
Identify the management class used to obtain data management information to allocate the data set. If omitted, the installation default is used.
mgmtclass
The management class, as defined by your system administration. The management class is used to obtain the data management-related information (migration, backup, and retention criteria) for the allocation of the data set.
LOAD_STORCLASS
Identify the storage class used to obtain storage information to allocate the data set. If omitted, the installation default is used.
storclass
The storage class, as defined by your system administration. The storage class is used to obtain the storage-related information for the allocation of the data set.
CLEAR_ALL_TABLES
Indicate whether you want load utility processing to stop or continue if the utility states that a table space is to be cleared before data is loaded. Specify:
YES
Clear the table space and continue processing. Data might be lost if all tables in the table space are not reloaded.
NO
Stop processing and do not clear the table space (the default value).
SORT_ROWS
Indicate whether you want to sort rows with a cluster index if one exists. Specify:
YES
Sort rows.
NO
Do not sort rows (the default value).
KEEP_COLUMN_ORDER
Controls the order of data to be loaded. This is an automatically generated keyword and should not be manually inserted into or removed from the generated DB2 LOAD JCL. This keyword, or lack of thereof, will be ignored when LOAD_DSNPRFX has been specified because the use of LOAD_DSNPRFX causes the LOAD control statements to be generated automatically and they always will be reflecting the order of the LOAD data. Hence LOAD_DSNPRFX forces KEEP_COLUMN_ORDER. / Reflects the order of columns in the data to be loaded and associated control statements. This is an automatically generated keyword and should not be manually inserted into or removed from the generated LOAD JCL. This keyword will be ignored when LOAD_DSNPRFX has been specified because the use of LOAD_DSNPRFX causes the LOAD control statements to be generated automatically and they always will reflect the order of the LOAD data. Hence LOAD_DSNPRFX forces KEEP_COLUMN_ORDER YES.
YES
Automatically generated by Optim when creating the DB2 LOAD JCL. Indicates that the DB2 LOAD data and its control file will reflect the original order of table columns as found in EXTRACT or ARCHIVE file.
NO
(Default) Indicates that the order of data and the LOAD control statements will reflect the columns changed by CM processing being moved to the end of a row (product behavior prior to APAR PI30591).
AGING
This keyword indicates that date values in the source columns are to be aged. It provides parameters to be used in the aging process. See AGING Keyword Parameters for detailed information about using this keyword.
REPORT_LEVEL
Indicate the level of detail you want in the process report. Specify:
DETAIL
Produce a detailed report (the default value).
SUMMARY
Produce a summary report.
FORCE_EXTERNAL_LOBS
Indicate whether Large Object (LOB) data from the Archive or Extract File is always to be stored in a Partitioned Data Set - Extended (PDS/E) data set.

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:

YES
Always store LOB data from the archive or extract file in a PDS/E data set that is separate from the input file.
NO
Store LOB data from the archive or extract file in a PDS/E data set only when the input file would otherwise contain table rows greater than 32 KB. NO is the default value.
ENFORCE_RI
Indicate whether you want Referential Integrity (RI) constraints enforced during the Load process. Specify:
YES
Check RI and discard any invalid row encountered during the Load, and include the ENFORCE YES clause in the LOAD DATA statement.
NO
Suspend RI checks during the Load and leave the table in Check Pending status, and include the ENFORCE NO clause in the LOAD DATA statement. Specify NO if you want to load all rows regardless of referential integrity and check RI after the load is done. NO is the default value.
EMPTY_TABLE_FOUND_RC4
Indicate the action you want taken when empty tables are detected during Load batch processing. Specify:
YES
Process the empty tables, issue a warning message, and end processing with a return code of RC=4.
NO
Do not process the empty tables and end processing with a return code of RC=0. NO is the default value.

Example

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

Required Load Utility DD Statements

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.