Unload function features and benefits
The Unload function replaces IMS HD Reorganization Unload utility (DFSURGU0).
The Unload function functionally replaces the HISAM Reorganization Unload utility (DFSURUL0). To use the Unload function instead of DFSURUL0, you must change the DFSURUL0 JCL to the HD Unload (DFSURGU0) format. For more information, see JCL-requirements5.
The Unload function reads a database and writes records to an HD Unload data set in hierarchical order. You can use this data set to reload the records in hierarchical order. When records are in order, database processing improves because fewer I/O operations are needed to retrieve data.
The Unload function offers the following features and benefits:
HALDBs
You can use the Unload function to unload a HALDB.
Segment selection
You can unload all segments or only selected segments by using the SEGSEL keyword. You can specify as many as 30 segment types. For more information, see SEGPOSO.
Decreased DL/I application program run time
An application program interface (API) allows batch DL/I application programs that use GET-type calls to use the facilities of the Unload function to retrieve segments faster than DL/I retrieves them. Programs that read large portions of a database sequentially might realize significant reductions in elapsed time and CPU usage. You do not have to recompile or relink-edit the application program to use the API. For more information, see API.
Ability to retrieve selected records
The Database Selection facility (DBSF) allows you to retrieve selected records from a database. You can print the records or write them to an HD Unload data set. The primary use of the DBSF is to enable you to create test databases. For more information, see Database-Selection-facility.
Ability to extract selected records
While performing an Unload, use the EXTCMDS keyword to manipulate the contents of the resulting output file. You define these manipulations using a command language. For example, you can select or delete specific segments meeting certain criteria and alter the format of the output file header and trailer records. For more information, see EXTCMDS
Ability to continue processing after a sequence error
The Unload function always sequence-checks twin chains. If the Unload function detects a sequence error, it terminates by default. The SEQERROR keyword allows you to specify that the Unload function continue with the unload. When the unload has ended, the Unload function gives you the appropriate data to correct the sequence error.
Ability to fix broken/invalid physical twin forward (PTF) and physical twin backward (PTB) root pointer chains
The USEINDEX keyword enables you to correct a broken/invalid PTF or PTB root pointer chain by forcing the roots to be accessed from an index:
- For HIDAM and PHIDAM databases, you can bypass bad PTF and PTB pointers on the root segment by forcing the Unload function to unload by using the primary index. Reloading the database corrects the pointer errors. If the primary index is invalid, you might be able to rebuild it by using the Index Build function.
- For HDAM and PHDAM databases with a secondary index whose target is the root segment and uses the root segment key, you can use the Unload function to unload by using the secondary index. You can reload the database to reconstruct the database pointers. If the database does not have a secondary index, you can define one temporarily and use the Sequential Scan feature of the Index Build function.
For more information, see USEINDEX.
User exit facility for processing each segment
The Unload function provides a user exit facility. For more information, see User-exits and USEREXIT.
HDAM-to-HIDAM migration and PHDAM-to-PHIDAM migration
The USEINDEX keyword, used with the Index Build function, lets you optimally convert an HDAM or PHDAM database to an HIDAM or PHIDAM database, respectively. This eliminates the following traditional requirements:
- Application program to unload the HDAM or PHDAM database and build an appropriate sort key
- Sorting of segments into key value sequence
- Application program to reload the HIDAM or PHDAM database