Partial extract using extract criteria

FM/IMS is able to place criteria against segments to determine if they are to be extracted. A group of criteria is combined into a Criteria Subset. A single criteria subset is used to determine if a database record is extracted, each of the field selection criteria is tested to determine if the database record is extracted. If you have multiple criteria subsets, it is possible for FM/IMS to extract the same database record multiple times. This is why when multiple criteria subsets have been specified, the JCL created by FM/IMS sorts the extracted data to remove duplicate data.

If you have specified either a keys file or Extract criteria, FM/IMS performs a partial extract of the primary database. For databases with logical relationships, FM/IMS only extracts segments from a logically-related database when the logical child segment type in the primary database has been selected for extract.

If you have selected the relationship criteria subset, the settings specified in this subset govern how FM/IMS chases logical relationships.

Through maintaining the logical relationship criteria subset, you are able to determine if in extracting the database FM/IMS:

  • Chooses to chase logical relationships between databases.
  • The number of each logical relationship that FM/IMS chases for each database record.

To extract statements using logical relationships:

  1. From the Primary Option panel, select Extract (option 3.3) and press Enter.

    The Extract Entry panel is displayed.

    Use the IVP sample database Data Sets. The member we are using is DJ2E.

  2. Notice that many of the fields on the Extract Entry panel are also on the Browse Entry panel. To fill out the fields that are common to both panels, follow one of these sets of instructions according to which Region type and PSB type you want the Extract to use:
  3. If you want the Extract to use existing criteria, enter 2 in the Criteria usage field and specify in the Criteria fields the name of the data set that contains the criteria you want your extract to use. If you want to edit these criteria before you run the Extract, enter "/" in the Edit criteria field. If you want to create new criteria for the Extract, enter 1 in the Criteria usage field.
  4. If you want the Extract to use a Key values file, enter "/" in the Use key values field.
  5. If you want either the Extract dialog or your Extract job to create a template for the Extract file, enter "/" in the Create extract template field.
  6. If you are extracting data from a DEDB with Sequentially Dependent (SDEP) segments, the extracted SDEP segments are to be loaded into a database and there is a requirement for the loaded SDEP segments to be in timestamp order, enter "/" in the SDEP in timestamp order field.
  7. Press Enter to process the data you entered. According to what you entered on the panel, one or more of these panels may be displayed in the order they are listed:
    • Subsystem Selection panel
      • Displayed when you enter no subsystem name or a subsystem name pattern.
      • Displays a list of IMS subsystems defined by the FM/IMS administrator at installation time.
    • PSB Selection panel
      • Displayed when you enter no PSB name or a PSB name pattern and select Static for the PSB type.
      • Displays a list of the PSBs in the PSB libraries for the specified subsystem.
      If the PSB libraries for the subsystem are not fixed, you specify the PSB libraries for the subsystem on the PSB and DBD Data Sets panel (option 0.6.7). If the PSB libraries for the subsystem are fixed, the FM/IMS administrator specifies the PSB libraries for the subsystem at installation time.
    • PCB Selection panel
      • Displayed when you select "Static" for PSB type and one of the following is true:
        • You enter no database name and there is more than one database PCB in the specified PSB, or
        • You enter a database name and there is more than one PCB for the database in the PSB, or
        • You enter a database name pattern and the PSB has PCBs for databases with names that match the pattern.
      • Displays a list of the PCBs in the specified PSB.
    • Database Selection panel
      • Displayed when you enter no database name or a database name pattern and select Dynamic for the PSB type.
      • Displays a list of the DBDs in the DBD libraries for the specified subsystem.

      If the DBD libraries for the subsystem are not fixed, you specify the DBD libraries for the subsystem on the PSB and DBD Data Sets panel (option 0.6.7). If the DBD libraries for the subsystem are fixed, the FM/IMS administrator specifies the DBD libraries for the subsystem at installation time.

    • AGN Selection panel
      • Displayed when all of these are true:
        • You select "BMP" for Region type.
        • The specified subsystem uses AGNs and has some of them listed in the FM/IMS installation options module.
        • You enter no AGN name or an AGN name pattern.
      • Displays the AGNs for the subsystem that are listed in the FM/IMS installation options module.

    On each selection panel that is displayed, enter S in the Cmd field adjacent to the item you want to select and press Enter.

  8. If you selected "Existing" for Criteria usage and the Edit criteria option or "New" for Criteria usage, the Criteria : Subset Selection panel is displayed. This is the first panel in the Edit criteria dialog. This dialog allows you to create or edit your criteria.

    Steps 9 to 15 illustrate how you create criteria for your extract.

  9. Type E against the Relationship Criteria and press Enter.
  10. Enter the following Max Occurrences to pursue per DB Record
    FM/IMS                      Relationship Criteria
    
    Criteria New
    Template FMN.IMS.IVP.TEMPLATE(DJ2E)
    
    Default max relationship occurrences to pursue        (Blank for no limit)
    
              Source    Source    Target                       Max occurrences to
    Cmd  Sel  DBD       segment   DBD       Relationship type  pursue per DB record
          *   DJ2E      LINKSTR   DJ3E      Bidirectional          2
          *   DJ2E      INSHIRE   DJ1E      Bidirectional          1
          *   DJ3E      INSUB     DJ2E      Bidirectional          1
          *   DJ1E      LINKSUB   DJ2E      Bidirectional          1
       **** End of data ****
  11. Press Enter.
  12. Type I against the Relationship criteria to create Field Selection criteria subset and press Enter.

    The Criteria: Segment Selection panel is displayed.

  13. Type E against the SUBURB segment and press Enter.

    The Criteria: Segment Layout panel is displayed.

  14. Under the Field Selection Criteria, type #2=FREMANTLE and press Enter.

    The top right screen displays Retrieving with qual SSA. If you press the Help function key (F1), the extended message is displayed.

    Note: The message is only displayed if you have specified a key in the selection criteria where FM/IMS retrieves using qualified SSA's for improved performance.
  15. Press the Exit function key (F3) three times to save the criteria.

    The Extract Entry panel is redisplayed. The top right corner of this panel displays the message, Criteria Set saved.

  16. Press Enter.

    The Extract: To Data Set Specification panel is displayed.

  17. Specify the data set name to extract the segments to and press Enter.

    The JCL is displayed.

  18. Submit the JCL.

    The report specifies the database extract details including the number of segments of each segment type extracted.

Note: The minimum region size is 2M.