Example 1
Use the PREINIT function with required keywords DBID=, AREA=, and BLKSIZE= (plus, there is one optional keyword, VOLUMES=) if you want to use SQL DDL statements to add a new table in a new data area to a loaded and open database, and you want to have the new table be instantly loaded and available. Without PREINIT, a new table can only be set as loaded if it is going into an existing area with another table set as loaded. To meet the requirements, the data area needs to be initialized and loaded before the new table and area can be cataloged, and PREINIT does that for you.
The standard DDNAME is used during a PREINIT, but the database is not opened, and 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, but DISP=SHR is allowed if a DISP=SHR is not specified. If DISP=SHR is specified, CA Datacom upgrades it to DISP=OLD to provide protection ensuring that the data set is not currently in use. The PREINIT function is meant to be used for new areas, not for databases with existing areas.
DBUTLTY opens the data set out of all normal context (such as not opening the database). The area is initialized with provided values and is set to be loaded. The data set name is saved in the CXX in the PREINIT list.
After completion of the PREINIT, the table can be created by SQL where the area is found to be not loaded but the PREINIT list entry is found to meet the requirement. The list entry is used for the area and deleted from the PREINIT list. When opened, the area must be found and initialized and loaded with the values required by the SQL DDL CREATE statement (or the prior definition, done in CA Datacom Datadictionary.
Example 2
See the last of the second example in PREINIT index area examples.
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|