Add to or refresh segments in a database from an input data file.
The Add function adds segments to a database from an input data file. Its purpose is to add additional data to a database
and/or to refresh some of the segments in the database. Therefore, do not attempt to use the Add function to load database,
as part of a database reorganization, or for reloading a database after changing the DBD definition.
The Add function does not re-initialize the database and does not perform a Zeroload of the database.
Syntax - Command Line
mfims imsdbu ADD {database-name|filename}
[[NO]CLS]
[[NO]COMPRESS[(program)]]
[DATA(position)]
[DSN(filespec)]
[ECHO(keyword,msglvl,stoplvl
[[NO]INI(filespec)]
[LAYOUT(type)]
[[NO]LIST(filespec)]
[LISTOPEN(disp)]
[[NO]LOG(filespec)]
[LRECL(length)]
[PROGRESS(no-of-segments)]
[RECFM(format)]
[[NO]REPLACE]
[[NO]SEGEXIT[(program)]]
[SEGM(position)]
Syntax - JCL
//ADD EXEC PGM=MFDBUJCL,PARM='ADD,database-name,{dataset-name | catalog-name}'
//SYSOUT DD SYSOUT=*
//INPUT DD DSN=input-dataset,DISP=SHR
Parameters - Command Line
- database-name
- The name of a database on which the function operates.
- filename
- The name of a file containing a list of databases on which the function operates.
- CLS
- Clears the screen before starting the utility. NOCLS prevents the initial clear screen and can be helpful when you are running
a series of utilities in a command file.
- COMPRESS
- Enables or disables the expansion of the input data file records.
- Sub-parameter
-
program
|
The name of a compression/expansion routine to use instead of the system-supplied routine.
|
- Syntax Rules
-
- Use COMPRESS only when LAYOUT(G) is specified. COMPRESS is not required and is ignored when LAYOUT(D), LAYOUT(I) or LAYOUT(S)
is specified.
- Specifying COMPRESS with no program name causes decompression using the CBLDCIMS program (built into the MFIMS software libraries).
You can override the name of the compression/expansion routine by specifying a user-written program name.
- DATA
- Specifies the starting position of the segment data in the data record.
- Sub-parameter
-
position
|
The starting position of the segment data within the data record.
|
- Syntax Rules
-
- A value of 1 corresponds to the first byte of the record data.
- When RECFM(V) is specified, the variable length record prefix (LL) is not considered part of the record data and does not
affect this value.
- Use DATA only when LAYOUT(G) is specified. COMPRESS is not required and is ignored when LAYOUT(D), LAYOUT(I) or LAYOUT(S)
is specified.
- DSN
- Specifies the dataset name of the input file containing the segment data.
- Sub-parameter
-
filespec
|
The dataset name of the input file containing the segment data.
|
- Syntax Rules
-
- If you specify the base name of
filespec as an asterisk (*) it is replaced by the DBD name.
- Use unique extensions for the input file names. This is enforced even if the database data files are in a different directory
than the input file.
- The input dataset resides in the current directory unless you specify a drive and/or directory.
- The input file name, not including the drive and directory, must not be the same as the name of the files for the database.
For example, the data files for a database named MYDBD would be
MYDBD.DAT and
MYDBD.IDX, and the input file name cannot be either of these file names.
- ECHO
- Controls the display of and interaction with the messages displayed by IMSDBU.
- Sub-parameters
-
keyword
|
The category of information displayed. One of the following:
- ALL
- Always displays processing messages, input source or detail information and the ending message. Warning and error messages
are displayed and stop for user input if the message level is equal to or greater than the
msglvl and
stoplvl values.
- MSGS
- Always displays processing messages and the ending message. No source or detail information is displayed. Warning and error
messages are displayed and stop for user input if the message level is equal to or greater than the
msglvl and
stoplvl values.
- ERREND
- Always displays the utility ending message. Warning and error messages are displayed and stop for user input if the message
level is equal to or greater than the
msglvl and
stoplvl values.
- ENDMSG
- Displays ending message only if the utility ending return code is equal to or greater than
msglvl. A "Press any key to continue" message is displayed and stops for input if the utility ending return code is equal to or
greater than the
stoplvl. Enter a
msglvl and/or
stoplvl value of zero to display and/or stop on every ending message.
- COND
- Both the warning/error and ending messages are conditional on the
msglvl and
stoplvl values. Warning and error messages are displayed and stop for user input if the message level is equal to or greater than
the
msglvl and
stoplvl values. The ending message is displayed if the ending return code is equal to or greater than
msglvl. You see the message "Press any key to continue" which requires input if the utility ending return code is equal to or greater
than the
stoplvl.
- ERRORS
- You see warning and error messages which require input if the message level is equal to or greater than the
msglvl and
stoplvl. You do not see the ending message.
|
msglvl
|
A value from 4 through 20 to indicate the severity of messages to display.1
|
stoplvl
|
A value from 4 through 20 to indicate the severity of messages to stop for user input.
1
|
1 Can take the following values:
Value
|
Category
|
Example Cause
|
4
|
General warning message
|
A minor coding error in DBD source which DBDGEN can make an assumption about and continue.
|
6
|
IMS specific warning message
|
A warning that a keyword or statement is not supported and is ignored - processing can continue.
|
8
|
General severe error
|
An incorrect coding in DBD source which cannot be compensated for, such as 'no DBD statement'.
|
10
|
IMS Option specific severe error
|
An unsupported feature was defined which cannot be compensated for, such as 'Exceeded some maximum'.
|
12
|
Severe error - possible temporary condition
|
A temporary I/O error such as a 'file locked' or 'database locked' status.
|
16
|
Severe error- permanent - likely installation problem
|
A permanent I/O error, such as an invalid data set name or member name, was input to a utility or an environment variable
is not set correctly.
|
20
|
Severe error - permanent
|
An unrecoverable I/O error or some other unexpected error.
|
- INI
- Specifies the default directives file.
- Sub-parameter
-
filespec
|
The name and location of the
.INI file containing directives that override the IMSDBU programmed defaults.
|
- Syntax Rules
-
- filespec can include a drive and/or directory if required. If you do not specify a drive or directory, IMSDBU looks for the named
.INI file in the current directory.
- Directives listed in the
.INI file override the IMSDBU programmed defaults.
- Directives entered on the command line or interactive screen override directives in the
.INI file.
- Specifying
NOINI prevents any
.INI file from overriding the programmed defaults.
- If you specify an
.INI file that does not exist, the programmed default directives are used as if
NOINI were specified.
- General Rules
-
- An
.INI file is an ASCII text file containing a heading,
[IMSDBU] on line 1, starting in column 1, followed by a list of
mfims imsdbu directives; one directive per line. A line is terminated by a return or an end-of-file. Comment lines are indicated by an
asterisk (*) or semi-colon (;) in column 1. For example:
[IMSDBU]
PROGRESS(1000)
;use local log
LOG(C:\MYDIR\MYDB.LOG)
- LAYOUT
- Specifies the type of the input or output file.
- Sub-parameter
-
type
|
The type of input file. One of:
- D
- The input file is an IMSDBU file layout. No additional directives are required to describe the input file, but you can specify
RECFM=U (for unformatted) if required.
- G
- The input file is a generic layout for any RECFM=V* specification other than VBA and VBM. This type requires VRECGEN-style
record descriptor bytes and also requires that SEGM and DATA are specified. .
- I
- The input file is an IBM format. This file includes variable length records and requires VRECGEN-style record descriptor bytes.
For an IBM unload file, the catalog must specify RECFM=VBM. SEGM and DATA parameters are predefined for IBM format and not
required.
- S
- The input file is a Micro Focus sequential file. This requires that SEGM and DATA are also specified.
|
- Syntax Rules
-
- LAYOUT(S) and LAYOUT(G) require the segment name offset (SEGM) and segment data offset (DATA) parameters specified. Since
there are no SEGM and DATA parameters in the file catalog MFDBUJCL will get these from the SPACE=parameter. The primary allocation specification is used to define SEGM and the secondary allocation specification is used to define
DATA. .
- General Rules
-
- LAYOUT(I) output files are not suitable for uploading to the mainframe and reloading IMS/ESA databases.
- LIST
- Controls the location and name of the detail listing file, which includes items such as source listings, completion status,
error messages and execution statistics.
- Sub-parameter
-
filespec
|
The name and location to use for the listing file.
|
- Syntax Rules
-
- filespec can include a drive and/or directory if required. If you do not specify a drive or directory, IMSDBU creates the listing
file in the current directory.
- NOLIST suppresses the creation of the listing file.
- To specify a path, you can use the convention of placing a dollar sign ($) in front of the name of an environment variable
that represents a path. For example,
LIST($ENVVAR\*.DOC) creates a list file of
dbdname.DOC in the directory named by the ENVVAR environment variable.
- Specifying
LIST(*.LST) or
LIST(*.RPT) causes the listing file to be created in the project listing directory.
- If no path is specified, the listing file is created in the current directory.
- If you specify the base name of
filespec as an asterisk (*), it is replaced by the DBD name; this allows IMSDBU to provide separate reports for functions that can
operate on multiple databases. It also assists in maintaining historical detailed reports by DBD name.
- Specifying
LIST with no
filespec is equivalent to specifying
LIST(*.LST).
- LISTOPEN
- Controls the open disposition of the detail listing file.
- Sub-parameter
-
disp
|
The disposition to use. One of:
- NEW
- Creates a new listing file or overwrites an existing one.
- MOD
- Appends the list output to an existing file or creates a new listing if one does not exist. MOD allows you to maintain a detailed
historical record of database functions.
|
- Syntax Rules
-
- LISTOPEN is ignored when NOLIST is specified.
- LOG
- Specifies the IMSDBU activity log, which shows the ending message status for each function.
- Sub-parameter
-
filespec
|
The name and location of the file to use as the IMSDBU activity log.
|
- Syntax Rules
-
- filespec can include a drive and/or directory if required. If you do not specify a drive or directory, the listing is created in the
current directory.
- Specifying NOLOG suppresses the log file output.
- General Rules
-
- The log file is created if it does not exist.
- The log file is historical with the most recent entries written to the end of the file.
- As the log file grows in size over time, it might require deletion periodically.
- LRECL
- Specifies the length for fixed length generic layout input records.
- Sub-parameter
-
length
|
The length for fixed length generic layout input records.
|
- Syntax Rules
-
- LRECL is required when loading from a fixed-length generic file; that is, when LAYOUT(G) is specified.
- LRECL is not required and is ignored when LAYOUT(D), LAYOUT(I) or LAYOUT(S) is specified.
- PROGRESS
- Controls the frequency of progress reporting.
- Sub-parameter
-
no-of-segments
|
A value between 0 and 9999 indicating the number of segments to process before displaying a progress message. 0 disables progress
reporting.
|
- Syntax Rules
-
- We recommend that you do not reduce the number of segments specified to a value below its default of 200. Very small values
measurably reduce the performance of the database function.
- For relatively fast systems, setting the value higher (such as to 1000 or larger) might improve performance slightly.
- General Rules
-
- The progress message could show the number of segments processed, or the percentage complete and an estimate of the time remaining.
- RECFM
- Specifies the format of the input or output records.
- Sub-parameter
-
format
|
The format of the input records. One of:
- V
- Records are variable length. With LAYOUT(G), each record is prefixed with a 2-byte record length (LL) and the file is in the
same format as created by the VRECGEN utility. With LAYOUT(S), files are in Micro Focus record sequential format.
- F
- Records are a fixed length.
- U
- Records are unformatted.
|
- Syntax Rules
-
- RECFM is not required and is ignored when LAYOUT(I) is specified.
- When
format is set to V and LAYOUT(G) is specified, each record is prefixed with a 2-byte record length (LL) and the file is in the same
format as created by the VRECGEN utility.
- When
format is set to V and LAYOUT(S) is specified, files are in Micro Focus record sequential format.
- When
format is set to F, you must also specify LRECL to provide the record length.
- REPLACE
- Specifies how duplicate root segments are to be processed. When adding segments to a database, a root collision occurs when
the key of a root segment in the input file already exists in the database. REPLACE causes the existing database root segment
(and its children) to be deleted and the segments from the input file to be inserted.
- Syntax Rules
-
- NOREPLACE causes the segments in the input file to be ignored and the existing database segments to be left as they were.
- SEGEXIT
- Specifies the name of a user-supplied exit program that can be used to control selection and modification of segment data
during the add process.
- Sub-parameter
-
program
|
The name of the exit program to use.
|
- Syntax Rules
-
- NOSEGEXIT disables this exit.
- SEGM
- Specifies the starting position of the 8-byte segment name in the data record.
- Sub-parameter
-
position
|
The starting position of the 8-byte segment name in the data record.
|
- Syntax Rules
-
- A value of 1 corresponds to the first byte of the record data.
- Use the SEGM directive only when LAYOUT(G) is specified.
- SEGM is not required and is ignored when LAYOUT(D), LAYOUT(I) or LAYOUT(S) is specified.
- When RECFM(V) is specified, the variable length record prefix (LL) is not considered part of the record data and does not
affect this value. That is, if the segment name is the first field following the LL field in a variable length file, specify
1 for the SEGM value.
- General Rules
-
- When loading Fast Path databases that use LTERM keys (related or non-related), the SEGM directive indicates the position of
the LTERM name and not the segment name.
Parameters - JCL
- database-name
- The name of a database on which the function operates.
- dataset-name
- Dataset name of the data to be added.
- catalog-name
- If the dataset containing the data to be added is in the JCL catalog, then you can specify the catalog name instead of the
dataset name.
- input-dataset
- The dataset containing input data.
Inputs
There are a variety of input file formats supported for the Add function. See the
Specialized and Generic Load Inputs of the
IMS Database Utility (IMSDBU)
topic for complete details of the different formats.
The database for the segment Add function must be an existing primary physical database. It must be either Zeroloaded or previously
loaded with data. An Add should not be run for any other kinds of databases. An error message results if you attempt an Add
function on one of the following databases:
- The primary index for a HIDAM database. A primary index database is not required. The
.IDX component of an MFIMS database is the equivalent of this index and is modified automatically when adding segments to the
primary database.
- Secondary index databases. These are modified automatically when adding segments to the primary database they index.
- Databases defined as ACCESS=LOGICAL. The physical databases contain the required pointers to support logical relationships.
- GSAM databases. The Add function does not support GSAM databases.
- A database which has not been Zeroloaded or previously loaded with data.
Exclusive use databases may be used with the Add function. IMSDBU does not support adding segments to User Exit databases.
The DBUTIL utility can be used for adding segments to User Exit databases.
Outputs
The database data files are modified by this function. Any secondary index databases are also modified. If the database contains
logical children definitions, the PtrUpdate function must be run before the database can be accessed by an application program.
Segments
To add segments to a database that contains logical relationships requires that the PtrUpdate function also be run against
it. This resolves the links between logical children segments and their logical parents. When adding segments to several logically
related databases, we recommend that you first perform the Add function against each database, and then run the PtrUpdate
function against each database.
The Makelist function can assist in identifying the databases included in the set of logically related databases.