LINK (Link to the CXX)

When a data area or index area is initialized, it is linked to the Directory (CXX) used in the INIT AREA=CXX function. The link is done using the CXX name. An edit when the data set is opened during all other processing helps ensure that the CXX and data set are linked. If the CXX and data set are found not to be linked, an error is produced.
datacom150
When a data area or index area is initialized, it is linked to the Directory (CXX) used in the INIT AREA=CXX function. The link is done using the CXX name. An edit when the data set is opened during all other processing helps ensure that the CXX and data set are linked. If the CXX and data set are found not to be linked, an error is produced.
The LINK function provides protection for all functions except INIT against JCL errors, for example, pointing to the production database instead of the test database. Therefore use extra caution to help ensure that the CXX in use and the data area or index area are correct when submitting an INIT. Of course the edit works when every CXX has a unique CXX name, which we recommend as a best practice. You can run the DBUTLTY REPORT MEMORY=MVS to obtain a list of MUFs on the local LPAR that JOB runs on. This report helps to identify any MUFs that have non-unique CXX names.
When you execute the LINK function, each area in the database is processed in the following sequence:
  1. The Index Area (IXX)
  2. Other index areas
  3. Data areas
Each area is processed as follows:
  • The area data set name from the Directory (CXX) is accessed.
  • If the data set name is not blanks, the area is opened.
  • If the open is successful, the control block of the area is read.
  • If the CXX name is found not to be current, it is updated and written.
Use the LINK function to link each index area and each data area in one database to a CXX without performing the INIT function. This would only be appropriate if you rename the CXX or copy a data area using a utility other than DBUTLTY to move data from one CXX to another.
If you intend to copy a data area data set from one CXX to another using a utility other than DBUTLTY to backup/load the data area, it is still necessary to do the following:
  1. If the receiving CXX data area is set as not loaded, then you need to first use DBUTLTY to INIT and null load the area to a scratch data set to get the area to a loaded status in the receiving CXX.
  2. Next, use CXXMAINT OPTION=ALTER.DBID=?.AREA=?.DSN=? to update the data set name to the name you want.
  3. Then use the non-DBUTLTY utility to copy the data to the new name.
  4. Follow the sequence above by doing the DBUTLTY LINK.
  5. Use DBUTLTY RETIX to index the area data that was copied.
The LINK function opens tables in all areas of the specified database. Use this function only when all areas have been initialized and the data areas loaded.
The Accounting Facility tables must all be defined as closed during a MUF enable before the LINK function can perform properly. After enabling the MUF, you can perform the LINK function for the Accounting Facility PRM and data area database(s) and then open the desired tables.
You cannot use the LINK function to fix the Compound Boolean Selection Index Area. You must use the INIT function for the Compound Boolean Selection Index Area.
With Simplify mode, the function can be executed in a DBUTLTY step with the MUF not enabled, for example immediately after a CXX is initialized with a different name and loaded from a backup. If MUF is enabled as is required without Simplify, the other rules apply about databases not being opened before the LINK is executed.
Each area of the database is attempted to be opened, and if the open is successful the LINK performs the action. For each individual area that cannot be opened and read, the action does not occur. A report then reports each area, the actions taken, and any error encountered.
Execute the LINK function with the following command format:
┌─ , ─────────┐ ►►─ LINK ─▼─ DBID=
nnnn
─┴─────────────────────────────────────────────────────►◄
 
Command
 
  •  
    LINK
    Invokes the function to link the Index Area and each data area in one database to a Directory (CXX) without performing the INIT function.
 
Required Keywords
 
  •  
    DBID=
    Identifies the database or databases whose data and Index Areas are to be linked. DBID= may repeat. Each occurrence may specify either a single number or a range of numbers.
    Every database specified by a DBID keyword is processed. Each database that is not defined generates an error and fails the function after all the databases are processed, except that a database in a range not defined is ignored.
    •  
      Valid Entries:
      One or more valid database IDs or a range of DBIDs 
      nnnn-mmmm
       (a range, for example, such as 100-250).
    •  
      Default Value:
      (No default)
The following shows the command to link the data and Index Areas in database 1 to the Directory that is used by the MUF to which the job is connected.
 Use the following as a guide to prepare your JCL. The JCL statements are for example only. Lowercase letters in a statement indicate a value you must supply. Code all statements to your site and installation standards.
//jobname
See the previous note and JCL Requirements
.
// EXEC PGM=DBUTLTY,REGION=2M //STEPLIB See the previous note and
JCL Requirements
.
//SYSIN DD * Command input LINK DBID=1-5000 /*
Sample Report
Following is a sample report page. For an example report header, see Sample Report Headers.
CONTROL CARD(S) .........1.........2.........3.........4.........5.........6.........7.........8 LINK DBID=1-5000 FUNCTION=LINK DBID=00001-05000
This page of the report shows the following:
  • The command exactly as entered.
  • An analysis of keywords encountered and expected. Any errors found are flagged with a note in the left margin.
  • Any messages related to syntax processing.
LINK REPORT DBID AREA CXXNAME DSN ERROR INFORMATION 1 IXX DBDVM0 ABCDE.DBDVM0.IXX001 1 DEM 1 PAY 1 PMF 2 IXX DBDVM0 ABCDE.DB.DBDVM0.IXX002 2 DD1 DBDVM0 ABCDE.DB.DBDVM0.DD1002 4 IXX DBDVM0 ABCDE.DB.DBDVM0.IXX004 4 PRM DBDVM0 ABCDE.DB.DBDVM0.PRM004 5 IXX 5 A00 5 A01 5 A02 5 A03 5 A04 6 IXX 15 IXX DBDVM0 ABCDE.DB.DBDVM0.IXX015 15 DDD DBDVM0 ABCDE.DB.DBDVM0.DDD015 15 MSG DBDVM0 ABCDE.DB.DBDVM0.MSG015 15 SIT DBDVM0 ABCDE.DB.DBDVM0.SIT015 16 IXX 16 SQ1 17 IXX 17 TTM 97 IXX X.DBDVM0.IXX097 74 (81) OPEN ALLOCATION ERROR 97 A01 X.DBDVM0.A01097 74 (81) OPEN ALLOCATION ERROR 297 IXX X.DBDVM0.IXX297 74 (81) OPEN ALLOCATION ERROR 297 I01 X.DBDVM0.I01297 74 (81) OPEN ALLOCATION ERROR 297 I02 X.DBDVM0.I02297 74 (81) OPEN ALLOCATION ERROR 297 I03 X.DBDVM0.I03297 74 (81) OPEN ALLOCATION ERROR 297 I04 X.DBDVM0.I04297 74 (81) OPEN ALLOCATION ERROR 297 I05 X.DBDVM0.I05297 74 (81) OPEN ALLOCATION ERROR 297 I06 X.DBDVM0.I06297 74 (81) OPEN ALLOCATION ERROR 297 I07 X.DBDVM0.I07297 74 (81) OPEN ALLOCATION ERROR 297 I08 X.DBDVM0.I08297 74 (81) OPEN ALLOCATION ERROR 297 I09 X.DBDVM0.I09297 74 (81) OPEN ALLOCATION ERROR 297 A01 X.DBDVM0.A01297 74 (81) OPEN ALLOCATION ERROR 397 IXX DBDVM0 X.DBDVM0.IXX397 397 A01 X.DBDVM0.A01397 58 (72) TABLE IS NOT LOADED 997 IXX DBDVM0 ABCDE.DB.DBDVM0.IXX997 997 A01 DBDVM0 ABCDE.DB.DBDVM0.A01997 1000 IXX 1000 SYS 1006 IXX XXXXO02.DBDVM0.IXX1006 74 (81) OPEN ALLOCATION ERROR 1006 CBS XXXXO02.DBDVM0.CBS1006 74 (81) OPEN ALLOCATION ERROR 1007 IXX ABCDEF.DB.DBDVM0.IXX1007 74 (81) OPEN ALLOCATION ERROR 1007 A01 ABCDEF.DB.DBDVM0.A011007 74 (81) OPEN ALLOCATION ERROR 1007 A02 ABCDEF.DB.MUF0.A021007 74 (81) OPEN ALLOCATION ERROR 2009 AR1 DBDVM0 ABCDEF.DB.DBDVM0.AR12009 2009 AR2 DBDVM0 ABCDEF.DB.DBDVM0.AR22009 * REQUEST COMPLETE DB10045E - ABNORMAL TERMINATION DUE TO ERROR(S)
This page of the report shows the following:
If an error prevents the opening of the area or occurs during the I/O events, the error is reported. An area with an error is skipped from having the CXXNAME updated in its control block. Each area successfully processed is reflected in the report. Error messages force the DBUTLTY function to fail, which makes it easy to identify success or failure.
A blank data set name is not reported as an error when:
  • A database is defined as VIRTUAL or SYSTEMDBID.
  • A data set is in the process of being built and as yet has no data sets.
Return codes of zero (0) are reported so that you can see which have no CXXNAME printed. You can then, if needed, research whether they needed the LINK option.