Load Utility: by Swapan Banerjee: ... Courtesy IBM Utility Guide & Reference Manual

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 20
At a glance
Powered by AI
The key takeaways from the document are that LOAD is used to load data into tables in DB2 and consists of several phases like initialization, reloading data, sorting keys if needed, building indexes, and enforcing constraints. It can be used to populate tables, replace existing data, or add new data.

The phases of Load are: UTILINIT (Initialization), RELOAD (Loading data), SORT (Sorting keys), BUILD (Building indexes), ENFORCE (Enforcing constraints).

To run the LOAD utility, the privilege set of the process must include ownership of the tables, SELECT privilege on the tables, DBADM authority for the database, SYSADM or SYSCTRL authority.

LOAD UTILITY : By Swapan Banerjee

...courtesy IBM Utility guide & reference manual

What is LOAD ?

LOAD
Use LOAD to load one or more tables of a table space. LOAD loads records into the tables and
builds or extends any indexes defined on them. If the table space already contains data, you can
choose whether you want to add the new data to the existing data or replace the existing data.

Running Load on objects with the DEFINE NO attribute

With DB2 version 7, you can run certain online utilities on table spaces or index spaces
that were defined with the DEFINE NO attribute. In this situation, the physical creation
of the data set is deferred until data is first inserted in the table space.

You can populate table spaces with undefined data sets by using the LOAD utility with
either the RESUME keyword, the REPLACE keyword, or both. Using LOAD in this
manner results in the following actions:

1. DB2 allocates the data sets.


2. DB2 updates the SPACE column in the catalog table to show that data sets exist.
3. DB2 loads the specified table space.

For a partitioned table space, all partitions are allocated even if the
LOAD is loading only one part. Avoid attempting to populate a partitioned
table space with concurrent LOAD PART jobs until after one of the jobs has
caused all the data sets to be created.
Load :
The following catalog tables can be loaded.

• SYSSTRINGS
• MODESELECT
• LUMODES
• LULIST
• USERNAMES
• LUNAMES
• LOCATIONS
• IPNAMES

You cannot run the LOAD utility on the DSNDB01 or DSNDB06 databases, except to
add lines to SYSIBM.SYSSTRINGS.
LOAD operates on a table space, so you must have authority for all tables in the table
space when you perform LOAD.
Authorization required: To execute this utility, the privilege set of the process must include
one of the following:
Ownership of the table
LOAD privilege for the database
DBADM or DBCTRL authority for the database
SYSCTRL or SYSADM authority

To run LOAD STATISTICS, the privilege set must include STATS authority on the database. To
run LOAD STATISTICS REPORT YES, the privilege set must also include the SELECT privilege
on the tables reported.

Phases of the LOAD utility

What are the phases of Load ?

Phase Description

UTILINIT Initialization and setup.


RELOAD Loading of record types and writing of temporary file records for indexes and foreign
keys. Check constraints are checked for each row. One pass through the sequential input data
set is made. Internal commits are taken to proide commit points at which to restart in case
operation should halt in this phase. Creates inline copies if you specified the COPYDDN or
RECOERYDDN keywords. If SORTKEYS is used, a subtask is started at the beginning of the
RELOAD phase to handle the work of sorting the keys. The sort subtask initializes and waits for
the main RELOAD phase to pass its keys to SORT. The RELOAD phase loads the data, extracts
the keys, and passes them in memory for sorting. At the end of the RELOAD phase, the last key
is passed to SORT, and record sorting completes. Note that load partition parallelism starts
subtasks. PREFORMAT for table spaces occurs at the end of the RELOAD phase.
SORT Sorting of temporary file records before creating indexes or alidating referential
constraints, if indexes or foreign keys exist. The SORT phase is skipped if all the following
conditions apply for the data processed during the RELOAD phase: There is not more than one
key per table All keys are the same type (index key, index foreign key, nonindexed foreign key)
The data being loaded or reloaded is in key order (if a key exists) The data being loaded or
reloaded is grouped by table and each input record is loaded into one table only.If you use the
SORTKEYS keyword, SORT passes the sorted keys in memory to the BUILD phase, which
builds the indexes
BUILD Creating indexes from temporary file records for all indexes defined on the loaded tables.
Detection of duplicate keys. Preformatting of indexes occurs at the end of the build phase.
SORTBLD If you specify a parallel index build, all activities that normally occur in both the SORT
and BUILD phases occur in the SORTBLD phase instead.
INDEXVAL Correction of unique index violations from the information in SYSERR, if any exist.
ENFORCE Checking of referential constraints, and correction of violations. Information about
violations of referential constraints are stored in SYSERR.
DISCARD Copying of records causing errors from the input data set to the discard data set.
REPORT Generation of a summary report, if you specified ENFORCE CONSTRAINT or if load
index validation is performed. The report is sent to SYSPRINT.
UTILTERM Cleanup.
Option descriptions

DATA Is used for clarity only. You identify the data selected for loading with table-name on the
INTO TABLE option.
INDDN ddname Specifies the data definition (DD) statement or template identifying the input
data set for the partition. The record format for the input data set must be fixed or variable. The
data set must be readable by the basic sequential access method (BSAM). The ddname is the
name of the input data set. The default is SYSREC.
INCURSOR cursor-name Specifies the cursor for the input data set. The cursor must be
declared before it is used by the LOAD utility. You cannot load into the same table where you
defined the cursor. Use the EXEC SQL utility control statement to define the cursor for the DB2
family cross loader function. The INCURSOR option is incompatible with the SHRLEVEL
CHANGE option. cursor-name is the cursor name. The column names in the SELECT
statement must be identical to the column names in the table being loaded. The AS clause in the
select list can be used to change the columns names returned by the SELECT statement.
PREFORMAT Specifies that the remaining pages are preformatted up to the high allocated
RBA in the table space and index spaces associated with the table specified in table-name. The
preformatting occurs after the data has been loaded and the indexes are built. PREFORMAT can
operate on an entire table space and its index spaces, or on a partition of a partitioned table
space and its corresponding partitioning index space. Specifying LOAD PREFORMAT (rather
than PART integer PREFORMAT) tells LOAD to serialize at the table space level, which can
inhibit concurrent processing of separate partitions. If you want to serialize at the partition level,
specify PART integer PREFORMAT.
RESUME Tells whether records are to be loaded into an empty or non-empty table space. For
nonsegmented table spaces, space occupied by rows that have been marked as deleted or by
rows of dropped tables is not reused.
NO Loads records into an empty table space. If the table space is not empty, and you
have not used REPLACE, a message is issued and the utility job step terminates with a
job step condition code of 8. For nonsegmented table spaces containing deleted rows or
rows of dropped tables, using the REPLACE keyword provides increased efficiency. The
default is NO, unless you override it with PART integer RESUME YES.
YES Loads records into a non-empty table space. If the table space is empty, a warning
message is issued, but the table space is loaded. Loading begins at the current end of
data in the table space. Space occupied by rows marked as deleted or by rows of
dropped tables is not reused.
SHRLEVEL Specifies the extent to which applications can concurrently access the table space
or partition during the LOAD utility. The parameter values below appear in order of increasing
extent of allowed concurrent access.
NONE Specifies that applications have no concurrent access to the table space or
partition. The default is NONE.
CHANGE Specifies that applications can concurrently read and write the table space or
partition it is loading. If you specify SHRLEVEL CHANGE, you can not specify the
following parameters: INCURSOR, RESUME NO, REPLACE, KEEPDICTIONARY,
LOG NO, ENFORCE NO, and SORTKEYS, STATISTICS, COPYDDN,
RECOVERYDDN, PREFORMAT, REUSE, and PART integer REPLACE. For a
partition-directed LOAD, if you specify SHRLEVEL CHANGE, then only RESUME
YES can be specified or inherited from the LOAD statement. LOAD SHRLEVEL
CHANGE does not perform the SORT, BUILD, SORTBLD, INDEXVAL, ENFORCE, or
REPORT phases, and the compatibility/concurrency considerations are different. A
LOAD SHRLEVEL CHANGE job functions like a mass INSERT. Whereas a regular
LOAD job drains the entire table space, LOAD SHRLEVEL CHANGE functions like an
INSERT statement and uses claims when accessing an object.
REPORT Determines if a set of messages is generated to report the collected statistics.
NO Indicates that the set of messages is not output to SYSPRINT. The default is NO.
YES Indicates that the set of messages is output to SYSPRINT. The messages
generated are dependent on the combination of keywords (such as TABLESPACE,
INDEX, TABLE, and COLUMN) specified with the RUNSTATS utility. However, these
messages are not dependent on the specification of the UPDATE option. REPORT YES
always generates a report of SPACE and ACCESSPATH statistics.

UPDATE Tells whether the collected statistics are inserted into the catalog tables. UPDATE also
allows you to select statistics used for access path selection or statistics used by database
administrators. What you specify under the UPDATE option affects what options you can specify
under the HISTORY option.
ALL Indicates that all collected statistics will be updated in the catalog. The default is
ALL. ACCESSPATH Indicates that only the catalog table columns that provide
statistics used for access path selection are updated.
SPACE Indicates that only the catalog table columns that provide statistics to help the
database administrator assess the status of a particular table space or index are
updated.
NONE Indicates that no catalog tables are updated with the collected statistics. This
option is only valid when REPORT YES is specified.

HISTORY

Records all catalog table inserts or updates to the catalog history tables. What you specify under
the UPDATE option affects what options you can specify under the HISTORY option. The table
below lists the HISTORY options allowed for each UPDATE option specified. The default will be
supplied by the value specified in STATISTICS HISTORY on panel DSNTIPO.
ALL Indicates that all collected statistics will be updated in the catalog history tables.
ACCESSPATH Indicates that only the catalog history table columns that provide
statistics used for access path selection are updated.
SPACE Indicates that only SPACE-related catalog statistics are updated in catalog
history tables.
NONE Indicates that no catalog history tables are updated with the collected statistics.

FORCEROLLUP

Determines if aggregation or rollup of statistics will take place when RUNSTATS is executed in
spite of some parts being empty. This will enable the optimizer to select the best access path.
The following are the available options for the FORCEROLLUP Keyword.
YES Indicates that forced aggregation or rollup processing is to be done, even though
some parts may not contain data.
NO Indicates that aggregation or rollup will be done only if data is available for all parts.

If data is not available for all parts, DSNU623I message will be issued, provided the
installation value for STATISTICS ROLLUP on panel DSNTIPO is set to NO.
KEYCARD Collects all of the distinct values in all of the 1 to n key column combinations for the
specified indexes. n is the number of columns in the index.
FREQVAL Controls the collection of frequent value statistics. If you specify FREQVAL, it must
be followed by two additional keywords:
NUMCOLS Indicates the number of key columns to concatenate together when collecting
frequent values from the specified index. Specifying ’3’ means to collect frequent values on the
concatenation of the first three key columns. The default is 1, which means collect frequent
values on the first key column of the index.
COUNT Indicates the number of frequent values to be collected. Specifying ’15’ means collect
15 frequent values from the specified key columns. The default is 10.
REUSE When used with the REPLACE option, specifies that LOAD should logically reset and
reuse DB2-managed data sets without deleting and redefining them. If you do not specify
REUSE, DB2 deletes and redefines DB2-managed data sets to reset them. REUSE must be
accompanied by REPLACE to do the logical reset for all data sets. However, if you specify
REUSE for the table space and REPLACE only at the partition level, only the replaced partitions
are logically reset.
If a data set has multiple extents, the extents will not be released if you specify the REUSE
parameter.
LOG
Tells whether logging is to occur during the RELOAD phase of the load process. YES Specifies
normal logging during the load process. All records loaded are logged. The default is YES. NO
Specifies no logging of data during the load process. The NO option sets the COPY-pending
restriction against the table space or partition that the loaded table resides in. No table or partition
in the table space can be updated by SQL until the restriction is removed.
If you load a single partition of a partitioned table space and the table space has a nonpartitioning
index, some logging might occur in the build phase as DB2 logs index structure changes. This
logging allows recoverability of the nonpartitioning index in case an abend occurs, and also
allows concurrency.
A LOB table space that was defined with LOG YES or LOG NO will affect logging while loading a
LOB column.

NOCOPYPEND
Specifies that LOAD is not to set the table space in the COPY-pending status, even though LOG
NO was specified. A NOCOPYPEND specification will not turn on or change any informational
COPY-pending (ICOPY) status for indexes. A NOCOPYPEND specification will not turn off any
COPY-pending status that was set prior to the LOAD. Normal completion of a LOAD LOG NO
NOCOPYPEND job will be return code 0 if no other errors or warnings exist. DB2 ignores a
NOCOPYPEND specification if you also specified COPYDDN to make a local site inline image
copy during the LOAD.

WORKDDN(ddname1,ddname2)
Specifies the DD statements for the temporary work file for sort input and sort output. Temporary
work files for sort input and output are required if the LOAD involves tables with indexes.
ddname1 is the DD name for the temporary work file for sort input. The default is SYSUT1.
ddname2 is the DD name for the temporary work file for sort output. The default is
SORTOUT. The WORKDDN keyword specifies either a DDNAME or a TEMPLATE name
specification from a previous TEMPLATE control statement. If utility processing detects that the
specified name is both a DDNAME in the current job step and a TEMPLATE name, the utility
uses the DDNAME.

SORTKEYS integer
Specifies that index keys will be sorted in parallel during the SORTBLD phase to improve
performance. Optionally, you may use integer to provide an estimate of the number of index
keys to be sorted. Integer must be a positive integer between 0 and 2 147 483 647. The default
is 0. SORTKEYS is recommended to improve performance unless the table space has no
indexes, or it has only one index and the data being loaded is already sorted in key sequence.
FORMAT
Identifies the format of the input record. If you use FORMAT, it uniquely determines the format
of the input, and no field specifications are allowed in an INTO TABLE option. Follow
FORMAT with either the UNLOAD or SQL/DS option.
UNLOAD
Specifies that the input record format is compatible with the DB2 unload format. (The DB2 unload
format is the result of REORG with the UNLOAD ONLY option.) Input records that were unloaded
by the REORG utility are loaded into the tables from which they were unloaded, if there is an
INTO TABLE option to specify each table. Do not add columns or change column definitions of
tables between running REORG UNLOAD ONLY and LOAD FORMAT UNLOAD. Any WHEN
clause on that statement is ignored; DB2 reloads the records into the same tables from which
they were unloaded. This ensures that the input records are loaded into the proper tables. Input
records that cannot be loaded are discarded. If the DCB RECFM parameter is specified on the
DD statement for the input data set, and the data set format has not been modified since the
REORG UNLOAD (ONLY) operation, the record format must be variable (RECFM=V).
SQL/DS
Specifies that the input record format is compatible with the SQL/DS unload format. The data type
of a column in the table to be loaded must be the same as the data type of the corresponding
column in the SQL/DS table. If the SQL/DS input contains rows for more than one table, the
WHEN clause of the INTO TABLE option tells which input records load into which DB2 table.
FLOAT
Specifies that LOAD is to expect the designated format for floating point numbers. (S390)
Specifies that LOAD is to expect that floating point numbers are provided in System/390
hexadecimal Floating Point (HFP) format. (S390) is the format that DB2 stores floating point
numbers in. It is also the default if you do not explicitly specify the FLOAT keyword.
(IEEE)
Specifies that LOAD is to expect that floating point numbers are provided in IEEE Binary Floating
Point (BFP) format.
EBCDIC Specifies that the input data file is EBCDIC. The default is EBCDIC.
ASCII Specifies that the input data file is ASCII. Numeric, date, time, and timestamp internal
formats are not affected by the ASCII option.
UNICODE Specifies that the input data file is UNICODE. The UNICODE option does not affect
the numeric, date, time, and timestamp formats.
CCSID Specifies up to three coded character set identifiers (CCSIDs) for the input file. The first
specifies the CCSID for SBCS data found in the input file, the second specifies the CCSID for
mixed DBCS data, and the third specifies the CCSID for DBCS data. If any of these are specified
as 0 or omitted, the CCSID of the corresponding data type in the input file is assumed to be the
same as the installation default CCSID; that is, if the input data is EBCDIC, the omitted CCSIDs
are assumed to be the EBCDIC CCSIDs specified at installation, and if the input data is ASCII,
the omitted CCSIDs are assumed to be the ASCII CCSIDs specified at installation. If the CCSIDs
of the input data file do not match the CCSIDs of the table being loaded, the input data is
converted to the table CCSIDs before being loaded. integer is any valid CCSID specification. If
the input data is UNICODE, the CCSIDs default to the UNICODE CCSIDs specified at system
installation.
NOSUBS
Specifies that LOAD is not to accept substitution characters in a string. A substitution character is
sometimes placed in a string when that string is being converted from ASCII to EBCDIC, or
converted from one CCSID to another.
ENFORCE
Specifies whether or not LOAD is to enforce check constraints and referential constraints.
CONSTRAINTS Indicates that constraints are to be enforced. If LOAD detects a
violation, it deletes the errant row and issues a message to identify it. If you specify this
option and referential constraints exist, sort input and sort output data sets are required.
The default is CONSTRAINTS.
NO Indicates that constraints are not to be enforced. This option places the target table
space in the CHECK-pending status if at least one referential or check constraint is
defined for the table.
ERRDDN ddname Specifies the DD statement for a work data set for error processing.
Information about errors encountered during processing is stored in this data set. A SYSERR
data set is required if you request discard processing. ddname is the DD name. The default is
SYSERR.
MAPDDN ddname
Specifies the DD statement for a work data set for error processing. It is used to map the identifier
of a table row back to the input record that caused an error. A SYSMAP data set is required if
you specify ENFORCE CONSTRAINTS and the tables have a referential relationship, or if you
request discard processing when loading one or more tables that contain unique indexes.
ddname is the DD name. The default is SYSMAP.

DISCARDDN ddname
Specifies the DD statement for a “discard data set”, to hold copies of records that are not loaded
(for example, if they contain conversion errors). The discard data set also holds copies of records
loaded, then removed (due to unique index errors, or referential or check constraint violations).
Input records can be flagged for discarding during RELOAD, INDEXVAL, and ENFORCE phases.
However, the discard data set is not written until the DISCARD phase when the flagged records
are copied from the input data set to the discard data set. The discard data set must be a
sequential data set that can be written to by BSAM, with the same record format, record length,
and block size as the input data set. ddname is the DD name. If you omit the DISCARDDN
option, the utility application program saves discarded records only if there is a SYSDISC DD
statement in the JCL input. The default is SYSDISC. The DISCARDDN keyword specifies
either a DDNAME or a TEMPLATE name specification from a previous TEMPLATE control
statement. If utility processing detects that the specified name is both a DDNAME in the current
job step and a TEMPLATE name, the utility uses the DDNAME.

DISCARDS integer
Specifies the maximum number of source records to be written on the discard data set. integer
can range from 0 to 2147483647. If the discard maximum is reached, LOAD abends, the discard
data set is empty, and you cannot see which records were discarded. You can either restart the
job with a larger limit, or terminate the utility. DISCARDS 0 specifies that there is no maximum.
The entire input data set can be discarded.
The default is DISCARDS 0.

SORTDEVT device-type
Specifies the device type for temporary data sets to be dynamically allocated by DFSORT. It can
be any device type acceptable to the DYNALLOC parameter of the SORT or OPTION options for
DFSORT. If you omit SORTDEVT and a sort is required, you must provide the DD statements
that the sort application program needs for the temporary data sets. A TEMPLATE specification
does not dynamically allocate sort work data sets. The SORTDEVT keyword controls dynamic
allocation of these data sets.
SORTNUM integer
Tells the number of temporary data sets to be dynamically allocated by the sort application
program. If you omit SORTDEVT, SORTNUM is ignored. If you use SORTDEVT and omit
SORTNUM, no value is passed to DFSORT. It is allowed to take its own default.
CONTINUEIF
Allows you to treat each input record as a portion of a larger record. After CONTINUEIF, write a
condition in one of these forms:
(start:end) = X’byte-string’
(start:end) = ’character-string’If the condition is true in any record, the next record is
concatenated with it before loading takes place. You can concatenate any number of records into
a larger record up to a maximum size of 32767 bytes.
Data in the input record can be in American National Standard Code for Information Interchange
(ASCII) or UNICODE, but the utility control statement always interprets character constants as
EBCDIC. To use CONTINUEIF with the ASCII or UNICODE option, you must code the condition
by using the hexadecimal form, not the character-string form. For example, use (1:1)=X’31’
rather than (1:1)=’1’.
Option descriptions for INTO TABLE
table-name Is the name of a table to be loaded. The table must be described in the catalog and
must not be a catalog table.
IGNOREFIELDS Tells whether LOAD should skip fields in the input data set that do not
correspond to columns in the target table. Examples of fields that do not correspond to table
columns are the DSN_NULL_IND_nnnnn, DSN_ROWID, and DSN_IDENTITY fields that are
generated by the REORG utility.
YES
Specifies that LOAD skips fields in the input data set that do not correspond to columns
in the target table. This can be useful if each input record contains a variable length field,
followed by some variable length data that you do not wish to load and then some data
that you want to load. Because of the variable length field, you cannot use the POSITION
keyword to skip over the variable length data that you do not want to load. By specifying
IGNOREFIELDS, you can give a field specification for the variable length data that you
do not want to load; and by giving it a name that is not one of the table column names, it
will be skipped over and not loaded. This option should be used with care, since it will
also cause fields to be skipped if you intend to load a column but have misspelled the
name.
When you run the UNLOAD utility or the REORG utility with the UNLOAD EXTERNAL or
DISCARD option, DB2 generates a LOAD statement that you can use to load the
unloaded data into any table that has a compatible format. If the source table has a
ROWID column that is defined with GENERATED ALWAYS, the generated LOAD
statement contains a dummy field named DSN_IDENTITY for the identity column. The
combination of IGNOREFIELDS and the dummy fields lets you load the unloaded data
into a compatible table that has GENERATED ALWAYS columns. If you want to include
the data from the identity column or ROWID column when you load the unloaded data
into a table, the identity column or ROWID column in the target table must be defined as
GENERATED BY DEFAULT. To use the generated LOAD statement, remove the
IGNOREFIELDS keyword and change the dummy field names to the names of the
corresponding columns in the target table.
No
Specifies no skipping of fields in the load process.
Field selection criterion: The criterion describes a condition that causes the DB2 column
to be loaded with NULL or its default value.
NULLIF field-selection-criterion Describes a condition that causes the DB2 column to be
loaded with NULL.
DEFAULTIF field-selection-criterion Describes a condition that causes the DB2 column to
be loaded with its default value.

Replacing one table in a single-table table space:

Replacing one table in a multiple-table table space:


Example 3 Load data from individual input data sets into the partitions
using Partition Parallelism, with SHRLEVEL CHANGE access. Use the TEMPLATE
control statement to define the data set naming convention for dynamic allocation.
Cross Loader : Hands-on:
//UTIL0001 EXEC PGM=DSNUTILB,REGION=4096K,PARM='DB2A'
//STEPLIB DD DISP=SHR,DSN=DB2A.DSNEXIT
// DD DISP=SHR,DSN=DB2A.DSNLOAD
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSIN DD *
EXEC SQL
SET CURRENT SQLID = 'DB2ASADM'
ENDEXEC
EXEC SQL
CREATE TABLE MYTAB12 LIKE SYSIBM.SYSTABLES
ENDEXEC
EXEC SQL
DECLARE C1 CURSOR FOR
SELECT * FROM SYSIBM.SYSTABLES
WHERE TYPE='T'
ORDER BY CREATEDTS DESC
FETCH FIRST 100 ROWS ONLY
ENDEXEC
LOAD DATA
INCURSOR C1
INTO TABLE MYTAB12
/*

SYSPRINT DISPLAY
DSNU000I DSNUGUTC - OUTPUT START FOR UTILITY, UTILID =
A367123.A367123U
DSNU050I DSNUGUTC - EXEC SQL SET CURRENT SQLID='DB2ASADM'
ENDEXEC
DSNU1180I DSNUGSQL - SQLCODE = 000, SUCCESSFUL EXECUTION
DSNU050I DSNUGUTC - EXEC SQL CREATE TABLE MYTAB12 LIKE
SYSIBM.SYSTABLES ENDE
DSNU1180I DSNUGSQL - SQLCODE = 000, SUCCESSFUL EXECUTION
DSNU050I DSNUGUTC - EXEC SQL DECLARE C1 CURSOR FOR SELECT *
FROM SYSIBM.SYST
CREATEDTS DESC FETCH FIRST 100 ROWS ONLY ENDEXEC
DSNU050I DSNUGUTC - LOAD DATA INCURSOR C1
DSNU650I DA06 DSNURWI - INTO TABLE MYTAB12
DSNU056I DA06 DSNUGMAP - TABLE 'A367123.MYTAB12' NOT FOUND
DSNU012I DSNUGBAC - UTILITY EXECUTION TERMINATED, HIGHEST
RETURN CODE=8

//UTIL0001 EXEC PGM=DSNUTILB,REGION=4096K,PARM='DB2A'


//STEPLIB DD DISP=SHR,DSN=DB2A.DSNEXIT
// DD DISP=SHR,DSN=DB2A.DSNLOAD
//SYSPRINT DD SYSOUT=*
//UTPRINT DD SYSOUT=*
//SYSIN DD *
EXEC SQL
SET CURRENT SQLID = 'DB2ASADM'
ENDEXEC
EXEC SQL
CREATE TABLE MYTAB13 LIKE SYSIBM.SYSTABLES
ENDEXEC
EXEC SQL
DECLARE C1 CURSOR FOR
SELECT * FROM SYSIBM.SYSTABLES
WHERE TYPE='T'
ORDER BY CREATEDTS DESC
FETCH FIRST 100 ROWS ONLY
ENDEXEC
LOAD DATA
INCURSOR C1
INTO TABLE DB2ASADM.MYTAB13
/*
-SYSPRINT DISPLAY

DSNU000I DSNUGUTC - OUTPUT START FOR UTILITY, UTILID =


A367123.A367123U
DSNU050I DSNUGUTC - EXEC SQL SET CURRENT SQLID='DB2ASADM'
ENDEXEC
DSNU1180I DSNUGSQL - SQLCODE = 000, SUCCESSFUL EXECUTION
DSNU050I DSNUGUTC - EXEC SQL CREATE TABLE MYTAB13 LIKE
SYSIBM.SYSTABLES ENDE
DSNU1180I DSNUGSQL - SQLCODE = 000, SUCCESSFUL EXECUTION
DSNU050I DSNUGUTC - EXEC SQL DECLARE C1 CURSOR FOR SELECT *
FROM SYSIBM.SYST
CREATEDTS DESC FETCH FIRST 100 ROWS ONLY ENDEXEC
DSNU050I DSNUGUTC - LOAD DATA INCURSOR C1
DSNU650I DA06 DSNURWI - INTO TABLE DB2ASADM.MYTAB13
DSNU304I DA06 DSNURWT - (RE)LOAD PHASE STATISTICS - NUMBER OF
RECORDS=100 FOR T
DSNU302I DSNURILD - (RE)LOAD PHASE STATISTICS - NUMBER OF INPUT
RECORDS PROCE
DSNU300I DSNURILD - (RE)LOAD PHASE COMPLETE, ELAPSED
TIME=00:00:00
DSNU010I DSNUGBAC - UTILITY EXECUTION COMPLETE, HIGHEST
RETURN CODE=0

UNLOAD

Authorization required: To execute this utility, the privilege set of the process must include
one of the following:
Ownership of the tables
SELECT privilege on the tables
DBADM authority for the database
SYSADM authority v SYSCTRL authority (catalog tables only)
-------------------------------------END-------------------------------------------------------------
Thank You

You might also like