Changing Data Source Structure: The REORG Subcommand

In this section:

How to:

The REORG subcommand enables you to make a variety of changes to the Master File after data has been entered in the FOCUS data source. REBUILD REORG is a two-step procedure that first dumps the data into a temporary workspace and then reloads it under a new Master File.

You can use REBUILD REORG to:

REBUILD REORG will not enable you to:

To accomplish these tasks you must use FIXFORM. See your MODIFY, documentation for more information.

Procedure: How to Use the REORG Subcommand

The following steps describe how to use the REORG subcommand:

  1. Before making any changes to the original Master File, make a copy of it with another name.
  2. Using an editor, make the desired edits to the copy of the Master File.
  3. Initiate the REBUILD facility by entering:
    REBUILD

    The following options are available:

    1. REBUILD        (Optimize the database structure)
    2. REORG          (Alter the database structure)
    3. INDEX          (Build/modify the database index)
    4. EXTERNAL INDEX (Build/modify an external index database)
    5. CHECK          (Check the database structure)
    6. TIMESTAMP      (Change the database timestamp)
    7. DATE NEW       (Convert old date formats to smartdate formats)
    8. MDINDEX        (Build/modify a multidimensional index)
  4. Select the REORG subcommand by entering:
    REORG or 2

    The options are:

    1. DUMP           (DUMP contents of the database)
    2. LOAD           (LOAD data into the database)

    If you want to mount a scratch tape for work space during the DUMP phase, you can type the name of the tape after the word REORG.

  5. Initiate the DUMP phase of the procedure by entering:
    DUMP or 1
  6. Enter the name of the data source you wish to dump from. Be sure to use the name of the original Master File for this phase.

    On z/OS, enter Enter the ddname.

  7. You can specify selection tests by entering YES. Only data that meets your specifications will be dumped. It is more likely, however, that you will want to dump the entire data source. To do so, enter:
    NO

    Statistics appear during the DUMP procedure, including the number of segments dumped and the name and statistics for the temporary file used to hold the data.

  8. After the DUMP phase is complete, you are ready to begin the second phase of REBUILD REORG: LOAD. Enter:
    REBUILD
  9. Select the REORG subcommand by entering:
    REORG or 2

    The options are:

    1. DUMP     (DUMP contents of the database)
    2. LOAD     (LOAD data into the database)
  10. Initiate the LOAD phase of the procedure by entering:
    LOAD or 2
  11. Enter the name of the data source you wish to load from the temporary file created during the dump phase. In most cases, this will be the new data source name.

At this stage, you have loaded the specified data from the original Master File into a new data source with the name you specified. It is important to remember that both the Master File and data source for the original Master File remain. You have three choices:

  • You may want to rename the original Master File and data source to prevent possible confusion.
  • You may rename the new Master File and data source to the original name. As a result, any existing FOCEXECs referencing the original name will run against the new data source.
  • You may delete the original Master File and data source after you verify that the new Master File and data source are correct and complete.

If you enter the name of a data source that already exists, (the original Master File) you are prompted that you will be appending data to a preexisting data source and asked if you wish to continue.

You are not asked if you want to append to an existing data source. The data source is created. If you want to append, when you issue the LOAD command, enter LOAD NOCREATE.

Enter N to terminate REBUILD execution. Enter Y to add the records in the temporary REBUILD file to the original FOCUS data source.

If duplicate field names occur in a Master File, REBUILD REORG is not supported.

You must issue either an allocation or a CREATE for a new data source being loaded.

Using the REORG Subcommand

The following examples illustrate how to use the REORG subcommand.

Example: Using the REORG Subcommand

First make a copy of the data source:

dynam copy employee.focus oldemp.focus

Now start the DUMP phase:

rebuild
Enter option
 1. REBUILD         (Optimize the database structure)
 2. REORG           (Alter the database structure)
 3. INDEX           (Build/modify the database index)
 4. EXTERNAL INDEX  (Build/modify an external index database)
 5. CHECK           (Check the database structure)
 6. TIMESTAMP       (Change the database timestamp)
 7. DATE NEW        (Convert old date formats to smartdate formats)
 8. MDINDEX         (Build/modify a multidimensional index)
reorg
Enter option
 1. DUMP              (DUMP contents of the database)
 2. LOAD              (LOAD data into the database)
 
dump
 
DUMP
ENTER NAME OF FOCUS/FUSION FILE
 > employee
ANY RECORD SELECTION TESTS? (YES/NO)
> no
 STARTING..
  DCB USED WITH FILE REBUILD  IS DCB=(RECFM=VB,LRECL=00088,BLKSIZE=23940)
 NUMBER OF SEGMENTS RETRIEVED=     576

Now start the LOAD phase:

 >  >  rebuild
 Enter option
  1. REBUILD           (Optimize the database structure)
  2. REORG             (Alter the database structure)
  3. INDEX             (Build/modify the database index)
  4. EXTERNAL INDEX    (Build/modify an external index database)
  5. CHECK             (Check the database structure)
  6. TIMESTAMP         (Change the database timestamp)
  7. DATE NEW          (Convert old date formats to smartdate formats)
  8. MDINDEX           (Build/modify a multidimensional index)
 >   reorg|
 Enter option
  1. DUMP              (DUMP contents of the database)
  2. LOAD              (LOAD data into the database)
LOAD
ENTER NAME OF FOCUS/FUSION FILE
> employee
 
 STARTING..
  NEW FILE EMPLOYEE           ON 05/14/1999 AT 09.41.37
 NUMBER OF SEGMENTS INPUT=     576
 >  >

Information Builders