PREINIT (Pre-Format Index and Data Areas)

The PREINIT function pre-formats (pre-initializes) a planned non-existing index area or data area. See PREINIT index area and PREINIT data area.
The PREINIT function pre-formats (pre-initializes) a planned non-existing index area or data area. See PREINIT index area and PREINIT data area.
PREINIT promotes 24X7 operations. When you use PREINIT to pre-format a new index area, to contain a key to be cataloged in the 24x7 way using a
Datacom Datadictionary
1000 APPLYCXX batch transaction, the database can be left open for all normal user applications while the key is built. Without PREINIT, cataloging a key into an index area requires that the area already exists and is in use by another key. Also, use PREINIT to pre-format a new data area to contain a table to be added using SQL DDL statements to CREATE a new table. If you do a PREINIT of an area that is later decided to have been done in error or is no longer needed, you can clean up the PREINIT list. To delete an entry on the PREINIT list, use the following:
The PREINIT list is reported using the DBUTLTY function REPORT with AREA=CXX,TYPE=P. It reports on all items in the PREINIT list. If the list is empty, it has nothing to report. The first page of the full CXX report (not type A) and the same report requested as TYPE=K provides PREINIT AREAS - NO (or YES) to alert users whether any PREINIT areas exist.
PREINIT index area updates with control information the first block in the pre-formatted index area. The first block is subsequently updated when maintenance is performed. The default block size is 4096 for all devices, except for 3380 devices that have a block size of 3860. The block size can be set using the optional keyword BLKSIZE=.
You can also use PREINIT to pre-format and null load a data area that does not already exist. PREINIT data area makes it possible for SQL to be used to create a table in a new area and, optionally, to create a table in a new database. The table is then immediately loaded and available, and the SQL create process can successfully complete.
Without PREINIT, SQL can only create a table if that table is created as loaded into an area that already has another table in it, and for which the area has already been loaded.
Summary of Requirements
  • You use the PREINIT function for an index area or data area out of normal DBUTLTY context. For example, the PREINIT does not validate that the database does or does not exist. Wheher a database exists or not is not a concern to the operation of the PREINIT function itself. Neither does PREINIT validate whether the area name exists. PREINIT can be used for many cases to allow complete or nearly complete 24x7 processing. The data set used with PREINIT is usually new, but it is possible and acceptable to use PREINIT with an existing data set. If you use PREINIT with an existing data set, the data set should neither be open nor a closed area containing data that is not intended to be overlaid.
  • Using PREINIT is expected to be a rare event, with a PREINIT list item lasting a few minutes at most. PREINIT therefore requires minimal reporting.
  • The PREINIT list exists at the CXX level and is reported in a REPORT function requested with AREA=CXX,TYPE=P.
  • The PREINIT function requires the basic information needed for a successful INIT, including the area name and database ID (DBID). For PREINIT data area, the block size is required, but for PREINIT index area, the block size is optional.
  • PREINIT does not open the database. PREINIT only opens the CXX.
  • The standard DDNAME used in an INIT is used during a PREINIT, but the database is not opened. Also, in a PREINIT, if the area exists and has a data set name, it is not known, meaning that the DD statement is required. We recommended using PREINIT with DISP=NEW or DISP=OLD. You can use PREINIT with DISP=SHR, too, except when DISP=SHR is specified, in which case
    upgrades the DISP=SHR to a DISP=OLD specification. DISP=OLD provides protection against the data set being currently in use. The PREINIT function is for new areas and not for databases with existing areas.
  • PREINIT formats the data set as the type of area needed. PREINIT formats the entire area for a data area to match the combination of a data INIT and null LOAD.
  • PREINIT updates the CXX with a new structure of a list of PREINIT data sets that includes the area type of either index or data, the area name, the block size, the number of tracks, and the data set name. If the area and database match an existing PREINIT entry, the previous entry is replaced by the current entry.
  • An item on the PREINIT list can be deleted using CXXMAINT OPTION=DPREINIT,DBID=n,AREA=aaa.
  • An item on the list does not mean it currently exists as a data set, because users can delete or rename data sets outside of
During a
Datacom Datadictionary
catalog, the following special actions occur:
  • If the database is new, the list is searched for the IXX area in that database. If found, the entry is taken and the information saved as the current IXX, and the index is set as loaded.
  • If the index area (not IXX) is new, the entry list is searched and, if found, the entry is taken.
  • If the data area is new or has no Data Set Name (DSN), the list is searched and, if found, the entry is taken.
On the first normal open of a data set that was built using PREINIT, the information that would normally be in a control block is added. An edit ensures that the data set that was opened has been subjected to a PREINIT and has never been used since initialization.
The PREINIT list is intended to be short-lived. It is not part of a CXX backup function and is therefore not available as the subject of a CXX load.