Partial extract using a Keys file

When you want to extract a subset of your database records, you can use a Keys file to specify the root segment of each record that you want to extract. FM/IMS extracts all segments of:
  • The database records that have their root key specified in the Keys file
  • The database records that include one or more logical parents of the logical child segments that are extracted

To perform a partial extract using a Keys file:

  1. In the IMS data panel, display the root segment type of your database.
    Note: While you can use any segment type from within the database hierarchy, the extracted keys are always drawn from the root segment.
  2. Scroll to the first segment instance that you want to extract to your Keys file.
  3. Issue the XKEY command. FM/IMS creates a sequential Keys file in the format:
    userid.XKEY.Dyymmdd.Thhmmss.dbd-name

    This file contains a list of the root segment keys, from the current segment forward through the database.

  4. Edit the Keys file to remove any root keys for records that you do not want to extract. This can be done manually, using the ISPF Editor, or programmatically, using IEB.
  5. Select option 3 Utilities from the Primary Options Menu and then option 3 Extract from the Utility Menu. The Extract Entry panel is displayed.
  6. 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:
  7. In the Criteria usage field, enter 3 to select an Extract that does not use criteria.
  8. In the Use key values field, enter / to select an Extract that uses a Key values file.
  9. 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.
  10. 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.
  11. 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 the 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 an s in the Cmd field adjacent to the item you want to select and press Enter.

  12. If you selected DLI for the Region type and did not select the Skip DB data set panel option, either the Database Data Set Display or the Database Data Set Specification panel is displayed.
    • The Database Data Set Display panel is displayed when a database that is a HALDB or a subsystem that is defined as dynamic allocation only is selected on the Extract Entry panel. This panel displays the names of the database data sets that the function will use. Verify that the database data sets listed are the ones you want the function to use. To confirm usage of these data sets and to proceed to the next panel in the dialog, press Enter.
    • The Database Data Set Specification panel is displayed when a database that is not a HALDB and a subsystem that is not defined as dynamic allocation only is selected on the Extract Entry panel. If you selected User profile for the Fetch DB dsnames from option, it displays the data set names saved in your user profile. If you selected DFSMDA members for the Fetch DB dsnames from option, it displays the data set names specified in the DFSMDA dynamic allocation members for the subsystem.
      The Database Data Set Specification panel is displayed when the Skip DB data set panel option is not selected, but it is also displayed when the Skip DB data set panel option is selected and one of the following conditions is true:
      • FM/IMS fails to obtain all the required data set names from either your user profile or the DFSMDA members.
      • One or more of the database data sets does not exist or has an invalid data set organization.

      If the displayed data set names are not the ones you want the function to use or no data set names are displayed, enter the data set names that you want the function to use and press Enter. To confirm usage of the displayed data set names and to proceed to the next panel in the dialog, press Enter once more.

  13. On the Extract Options panel, specify the name of your Keys file in the Key Values fields and press Enter. The To Data Set Specification panel is displayed.
  14. On the To Data Set Specification panel, specify the name of the data set that you want your extract data stored in. This must be a sequential file.
  15. Specify the Disposition and, if necessary, the Allocation parameters for the Extract file (see Creating a full copy of a database).
  16. Press Enter. FM/IMS uses the data you specified in the dialog to generate JCL for the Extract job. You can edit the JCL before submitting the job. Submit the JCL.

Once the JCL is submitted, FM/IMS reads the Keys file and, for each key, extracts the root segment and all of its dependents.