Previous Topic: Select UtilitiesNext Topic: Reload an IMS Database


Extract an IMS Database

The Extract utility lets you extract segments from an IMS database and write them to a sequential data set. You can reload the extracted segments into an IMS database using the Reload utility. The database types supported are: Fast Path (DEDB and MSDB), HDAM, HIDAM, (S)HISAM, (S)HSAM and logical databases.

To extract segments from and IMS database

  1. Select UTILITIES from the Main Menu screen.

    The Utilities Menu screen opens.

  2. Select EXTRACT from the menu.

    The Extract IMS Database screen opens.

    ------------- CA File Master Plus for IMS -- Extract IMS Database ------------- COMMAND ===> IMS Database to Extract: IMS Environment ===> ________ PSB or ACB Name ===> ________ (if static PSBLIB being used) DBD Name ===> ______ (optional if PSB Name specified) Output Extract File: Dataset name ===> Disposition ===> ___ (NEW or SHR or OLD) Extract all Segments ===> Y Y/N (N for Segment Name Selection Screen) Execution mode ===> E S = Submit JCL E = Edit JCL O = Online Record Layout for Selection: Layout dataset ===> CRL dataset ===> Selection Criteria below or Selection Criteria Member ===> ===> ===> ===>

  3. Complete the following fields:
    IMS Environment

    Defines the IMS environment to resolve various processing parameters related to the extraction of an IMS database. The name of an IMS environment corresponds to a member name within the IMS environment Parm PDS that is updated using option 0.5.

    The IMS environment is defined as a DLI or a BMP environment. The type of IMS environment specifies whether the extract process is executed in DLI mode or within a BMP region.

    A wildcarded IMS environment name retrieves a directory of IMS environments matching that wildcard.

    PSB or ACB Name

    Defines the PSB or ACB Name. If blank, a dynamic PSB for DLI or a dynamic ACB for BMP is generated.

    In a DLI environment, the specified PSB name must be a member in a data set within the PSBLIB concatenation specified in the current IMS Environment.

    In a BMP environment, the specified ACB name must be a member in a data set within the ACBLIB concatenation specified in the current IMS Environment

    These names can also be a wildcard.

    DBD Name

    Defines the DBD name to indicate the database for extraction. The DBD name must be a member in a data set within the DBDLIB concatenation specified in the current IMS Environment.

    This name can also be a wildcard.

    Dataset Name

    Defines the sequential data set that receives the segments.

    Disposition

    Specifies the sequential data set's current disposition.

    Values: NEW, SHR, OLD

    Extract all Seg Names

    Specifies whether to extract all or only a subset of the segment names.

    Values: Y (Yes), N (No)

    When this field contains N, you will see the Select Segment Screen that allows selection of the segments names that are to be processed.

    When this field contains Y, the extract process is performed on all segment names in the database.

    Execution mode

    Specifies the execution mode.

    Values: S (Submit JCL), E (Edit JCL), O (Online JCL)

    Layout dataset

    Defines the DSN of the record layout data set that contains layouts for segments in this database. This is required only when selection references data by its field name and no CRL defines the layout.

    You may enter a wildcarded DSN or a DSN list specification to help locate the DSN you want.

    Enter 'FMCONCAT' to select the DSNList that contains the layout concatenations if the layouts are in different PDSs.

    Note: For more information about creating concatenated PDSs, see the chapter "Working with the DSNList Directory."

    CRL Dataset

    Defines the CRL data set to extract the data set using a Custom Record Layout. This data set must contain same-named CRLs as the segment names defined in the DBD. The segments that share same-named CRLs are used. This is required only when selection references data by its field name and no ordinary layout describes the data.

    You may enter a wildcarded DSN or a DSN list specification to help locate the DSN you want.

    Selection Criteria or Selection Criteria Member

    Specifies the selection criteria to filter the IMS database records of the input database. Dynamic Selection is entered free form. If a Selection Criteria Member is used, then this member must be defined in the Selection Criteria PDS, defined in option 0.3, Define and Update Processing Parms. The Selection criteria member value can also be a wildcard.

    The selection criteria are used to specify a filter based on the following types of parameters:

    • Condition that evaluates data values in each segment
    • Presence of a character string within a segment or specified columns or field name from a record layout
    • Limit to the number of IMS database records to be selected
    • Use of a cataloged selection criteria parameter member defined using CA File Master Plus for IMS Option 0.3, Define and Update Processing Parms or Option 5 Filter.
    • To assist in the entry of the selection, use the LAYOUT[ROOT|segname] command. When this is entered on the command line, a screen with the ROOT's or segname's copybook is displayed. Enter the selection criteria on that screen. If the optional parameter is omitted, a screen with the database's segments is displayed, from which you can select the appropriate segment.

Selection Criteria

Description

IFREC(segname)

Qualifies subsequent selection criteria to a specific IMS database record. If no IFREC or IFSEG is specified, dynamic selection criteria applies to the ROOT segment. The selected segment along with its entire IMS database record is returned.

IFSEG(segname)

Qualifies subsequent selection criteria to a specific database segment. If no IFREC or IFSEG is specified, dynamic selection criteria applies to the ROOT segment.

When the segment matches the selection criteria, the segment is selected, along with its children, and all of the segments in its parental path. All children of the segments in the parental path are also selected. No twins of the selected segment or twins of any of the segments in the parental path will be selected, or any of their children. (Twins have the same segment name and exact same parent segment). In addition, the rest of the IMS database record will be selected.

'TEXAS'

'TEXAS' in any case anywhere in the segment.

C'TEXAS'

Character string 'TEXAS' anywhere in the segment.

80 EQ C'NY'

Position 80 – 81 of any segment equals 'NY'.

STATE-CODE NE 'NY'

Field STATE-CODE not equal 'NY' (requires LAYOUT info).

STATE-CODE = C'NY' C'TX'

Field STATE-CODE equal to 'NY' or 'TX'.

80 = C'NY,TX' AND

Position 80-81 equals 'NY' or 'TX' AND.

100 = C"100,000"

Position 100-106 of any segment equals '100,000'.

Note: Quotes are required when the search string contains a comma.

TRAN-DD GT '01' AND TRAN-DD LT '06'

Field TRAND-DD is either '02', '03', '04' or '05'.

10(4) EQP

Position 10-13 of any segment is a valid packed value.

21 = P'0'

Position 21 of any segment is a packed '0'.

100(2) = P'0,1,999'

Position 100-101 of any segment is either P'0', P'1', or P'999'.

101(20) CO 'NEW YORK'

'NEW YORK' in any case of any segment is found anywhere in position 101-120.

STARTKEY='56789'

Start segment selection with the root segment whose key is GTEQ to '56789'.

INLIM=5000

Stop reading/selection after reading 5000 IMS database records.

SELLIM=1000

Only select 1000 IMS database records which match the specified selection criteria.

80 = C'NY' AND 100 = C'001'

Compound condition (OR also supported).

STATE-CODE EQ C'NY' AND COUNTY-CODE EQ C'001'

Compound condition with fields.

Valid condition relational operators

= or EQ Equal

EQP Equal packed value

EQN Equal numeric value

^= or NE Not equal

NEP Not equal packed value

NEN Not equal numeric value

> or GT Greater than

>= or GE Greater than or equal

< or LT Less than

<= or LE Less than or equal

CO Contains (that is, the specified literal is anywhere within the scan length or field)

Multiple literals may be specified by listing the literals or by listing the literal values within apostrophes separated by a comma. Following are some examples of conditions with multiple literal values.

Conditions

Multiple Literal Values

80 = C'NY' C'NJ' C'MA'

Segment position 80-81 equals one of the three values.

80 = C'NY,NJ,MA'

Segment position 80-81 equals one of the three values.

80 = C"NY,NJ,MA"

Segment position 80-97 equals C'NY,NJ,MA' (with commas).

100(2) = P'0,1,999'

2-byte packed field in segment position 100 equals one of the three values.

'abc,123,xyz'

Segment contains one of the three values.

"abc,123,xyz"

Segment contains value 'abc,123,xyz' (with commas).

When the comparison will be performed on another field within the same segment and not a literal, the part of the condition to the right of the operands specify a numeric field position with the record or a record layout field name.

Example:

Conditions

Numeric Field Position

80(2) > 84

Position 80-81 is greater than position 84-85.

STATE-CODE EQ PREV-STATE-CODE

Fields STATE-CODE and PREV-STATE-CODE are equal.

A condition to select segments based on the presence of a character string anywhere within a field uses the CO (contains) relational operator.

Example:

101(20) CO 'NEW YORK'—Looks for the character string anywhere in position 101-120.

When looking for a character string anywhere within a segment, you just require the literal specification.

Example:

C'NEW YORK'—Looks for 'NEW YORK' (upper case) anywhere in a segment.

C'new york'—Looks for 'new york' (lower case) anywhere in a segment.

C"100,00"—Looks for '100,00' (including comma anywhere in a segment.

'NEW YORK' or 'new york"—Looks for 'new york' (any case) anywhere in a segment.

X'FFFF'—Looks for a hex 'FFFF' anywhere in a segment.

P'0'—Looks for a packed zero (length 1 – 16) anywhere in a segment.

N'5'—When a field name is provided it looks for a X'05' for a binary field, P'5' for a packed field, and N'5' for a numeric display field. Without a field name it looks for a N'5'.

Specify the starting point for the selection of segments by use of the STARTKEY keyword.

Example:

STARTKEY='56789'—Means to select IMS database records whose root key is equal to or greater than '56789'.

To limit the number of IMS database records read or processed for selection, the syntax is:

Example:

INLIM(n)—Says stop reading and selecting IMS database records after reading n IMS database records.

SELLIM(n)—Says to select n IMS database records that match the specified selection criteria.

Note: If SELLIM is greater than INLIM, processing stops after the INLIM value has been reached. If SELLIM is less than INLIM, processing stops when either the SELLIM or INLIM value is reached.