Creating a file with FILEMGMT

From m204wiki
Revision as of 21:11, 17 April 2014 by JAL (talk | contribs)
Jump to navigation Jump to search

Overview of creating files

Prerequisites:

  • You must have Dictionary/204 and its subsystems running in order to use FILEMGMT.
  • Before working your way through the File Management Subsystem facility (FILEMGMT) interface to create a file, you should have made decisions about the organization, recovery options, and security for the file you are creating. See File design (File management) for more information.

Adding a file to the database includes the following steps:

  1. Defining the file organization and recovery options (File Definition - Organization screen).
  2. Defining the file security (File Definition - Security screen).
  3. For procedure files, defining the parameters for the procedures contained in the file (File Definition - Procedure screen).
  4. For data files, defining fields, records, and field groups in the following order:
    1. Defining the fields in the file. (Field Name List screen; Field Attributes screen)
    2. Defining the records in the file. (Record Name LIst screen; Record Definitions screen)
    3. Defining the field groups in the file. (Optional. Field Group List screen; Field Group Definition screen.

      See "Field group maintenance" in the Rocket Model 204 Dictionary/204 and Data Administration Guide for details.

  5. Sizing the file and its tables. (File Size Definition screen)
  6. Modifying the file's field, record, and field group definitions and the size specifications, as needed.
  7. Executing the CREATE command (Execute Commands screen).

Defining file organization

  1. Log on to FILEMGMT as described in Logging on to FILEMGMT.
  2. Select the FILE Maintenance CREATE function (number 1) from the primary screen.

    FILEMGMT displays the first of the three File Definition screens, the Organization Screen:

File Definition - Organization screen

FILEMGMT File Definition - Organization PAGE 1 OF 3 Filename: VEHICLES FICREATE: 7.5 LANGUAGE: US Active/Inactive I FILE ORGANIZATION Opt Fld Ext: N RFG: N LG FILES: N FILEORG X' 0E ' Entry:__ Sorted:_ Hash:X Unordered:_ Reuse Record Numbers:_ Sort/Hash Key: Req Evry Rec: X Enable Skewing: _ Table B Auto Incr Pages: 0 Table D Auto Incr Pages: 0 Table X Auto Incr Pages: 0 File Models: None X 1nf _ Numeric Validation_ FILEMODL X' 00 ' FILE OPTIONS FOPT X' 00 ' Disable Lock Pending Updates: _ Only FM Defines New Fields: _ No Procedure Statement Numbers: _ No Procedure Statement Labels:_ Enable Date Time Stamp: N FILE RECOVERY OPTIONS FRCVOPT X' 00 ' Disable Transaction Backout: _ No Rollforward (RF): _ No RF Logging: _ No Checkpoint (CK) Logging: _ No Updates Without RF Logging: _ No Updates Without CK Logging:_ All Updates Applied During RF: _ No Discontinuities Allowed: _ Format File During CREATE: Y Verify Disk Updates: N ===> 1=HELp 2= 3=QUIt 4=FIElds 5=WIDen 6=COMmands 7= 8=FORward 9=SIZe 10= 11= 12=END

You use the File Definition - Organization screen to name a new file and to specify file organization parameters. When this screen is displayed for a file for the first time, the standard Model 204 default values for the parameters are used.

Model 204 default values are supplied for any parameters for which you do not fill in values.

You select options from the choices on the screen, and FILEMGMT uses your selections to compute appropriate values for the Model 204 FILEMODL, FILEORG, FOPT, and FRCVOPT parameters.

  1. In the Filename input field, enter the name of the file that you are creating.

    The name can be as many as eight characters long. The file name cannot be FILE or GROUP and cannot start with CCA, SYS, OUT, TAPE, or a number. It must start with a letter, and can contain only letters, numbers, and the following special characters:

    • At sign (@)
    • Pound sign (#)
    • Dollar sign ($)
  2. The FICREATE input field displays the Model 204 version number for the file that you are creating. FILEMGMT uses FICREATE to calculate the file size and validate certain Model 204 file features. Enter a different version number if needed.
  3. The LANGUAGE input field displays the language of the file that you are creating (set by the LANGFILE parameter). The default is U.S. English. Enter a different language if needed.
  4. Change the Active/Inactive default value as needed.

    The Active/Inactive input field specifies how the commands in your file will be processed when you execute commands from the Execute Commands screen.

    Active or inactive indicates the mode you selected on the Organization screen or last used to execute commands against the file. The file itself is referred to as active or inactive, depending on the mode in which commands for the file were last executed.

    If you have permissions to change the value, and your system supports the alternative option you choose, your entry will override the system default set by the system administrator.

    • Type A to create an Active file. The commands will be executed immediately (upon verifying your permissions) or later in a batch file. Select the active execution mode if you choose to transform the file to current release format. Set FICREATE to the current release number.
    • Type I to create an Inactive file. The commands will be generated and stored in separate files for later execution.

      Active and inactive options are described in Execution options and Execute Commands screen.

  5. In the Opt Fld Ext (optimized field extract) input field, enter Y to add a length byte to every non-preallocated (or non-OCCURS) field, which could result in faster field extraction. The improvement is most noticeable when you have built records with a large number of fields. Entering Y sets FILEORG to X'80'.

    The default is N: non-preallocated (or non-OCCURS) fields that are type FLOAT, CODED, and BINARY are not stored with a preceding length byte. See Preallocated fields for more information on preallocated and non-preallocated fields.

  6. In the RFG input field, enter Y to enable repeating field groups. Repeating field groups, available in Model 204 version 7.5, let you view and process groups of fields as a logical entity. Files with repeating field groups can have up to 32,000 fields. For more information, see Field group (File architecture).

    Entering Y sets FILEORG to X'100'. Note that the FILEORG X'100' attributes (such as CHUNK, DATETIME, and so on) are not currently supported by FILEMGMT.

  7. In the LG Files input field, enter Y to enable support for large files. Large files, available in Model 204 version 7.5, can hold up to 48 million records. Entering Y sets FILEORG to X'200'.
  8. In the FILE ORGANIZATION section, select file organization characteristics for the specified file. FILEMGMT computes the Model 204 FILEORG parameter from your selections and displays the computed value. See File design (File management) for details on the advantages and disadvantages of each file organization type.
    1. Select one of the following options:
      Option Parameter value Description
      Entry FILEORG X'00' Records are stored in the file in the order in which they are entered. You cannot reorder records or reuse the record numbers of deleted records. Entry is the default file organization.
      Sorted FILEORG X'01' Records are stored in the file in order by the sort key that you specify. Sorted is less efficient than the other options and is not recommended.
      Hash FILEORG X'08' Records are stored in the file in order by the hash key that you specify.
      Unordered FILEORG X'20' Records are stored in the file in the order in which they are entered. You can reorder records and reuse the record numbers of deleted records.
    2. A record is stored on a page if there is sufficient space (as determined by the BREUSE parameter) and if there is an unused record number.

      In the Reuse Record Numbers input field, enter Y or N.

      Available with Unordered, Hash, or Sorted file organization. Select Reuse Record Numbers if you want the record numbers of deleted records to be reused for new records added, provided that the record number is available on the Table B page to which the new record is being added. Selecting Reuse Record Numbers sets the FILEORG X'04' bit.

    3. Enter a Sort or Hash key, if applicable.

      If you have selected Hash or Sorted as the file organization, enter the name of the sort or hash key field. The entry must be a valid Model 204 field name (1-70 characters). The requirements for a valid field name are described in Field name rules. The sort or hash key field must exist in every record in the file.

      If you have selected the Entry or Unordered file organization option, leave Sort/Hash Key blank.

    4. In the Req Every Rec input field:

      If you have selected Hash or Sorted as the file organization, enter X to place a hash key (for hashed files) or a sort key (for sorted files) on every record. This option is required for hashed or sorted files because a key on every record is needed to process the file correctly. This option sets the FILEORG X'02' bit.

      If you have selected the Entry or Unordered file organization option, leave Req Evry Rec blank.

    5. Leave the Enable Skewing input field blank. Skewing is an obsolete method of physical storage that was designed to improve efficiency during sequential searches. An X would indicate that blocks within a track were stored in a skewed order.
    6. Select the following Auto Increase options as needed. See File size calculation in detail for details.
      • Table B Auto Incr Pages: If you want Model 204 to automatically increase Table B when it becomes full, enter the number of pages to increase Table B by. This sets the parameter BAUTOINC to the specified value.
      • Table D Auto Incr Pages: If you want Model 204 to automatically increase Table D when it becomes full, enter the number of pages to increase Table D by. This sets the parameter DAUTOINC to the specified value.
      • Table X Auto Incr Pages: If you want Model 204 to automatically increase Table X when it becomes full, enter the number of pages to increase Table X by. This sets the parameter XAUTOINC to the specified value. To use Table X:

        The file must have been created in Model 204 version 7.1.0 or later.

        The file must have an organization type of Entry or Unordered.

  9. File Models: A file model is a set of default file and field attributes. Rocket Software recommends that you use the default setting.
  10. In the FILE OPTIONS section, select the characteristics of the file you are creating. FILEMGMT computes the Model 204 FOPT parameter from your selections and displays the computed value.
    Disable Lock Pending Updates Transaction back out locks an update until the transaction is committed, allowing an update to be backed out prior to the commit if for any reason the transaction does not finish. By disabling Lock Pending Updates, the feature Transaction back out is also disabled (Disable Transaction Backout must also be selected). If Disable lock pending updates is selected, incomplete transactions may be present in the file which may result in a file that is logically inconsistent. (FOPT=X'02')

    The default is null.

    Only FM Defines New Fields This option prevents the DEFINE FIELD command from being issued without using the FILEMGMT facility. The purpose of this option is to maintain the integrity of the dictionary. By using the FILEMGMT facility to define fields, the relationship between a file, the records in the file and the fields and their relationship to the file and the records within the file is automatically maintained in the Dictionary. (FOPT=X'01')

    The default is that new fields can be defined outside of FILEMGMT on the command line.

    No Procedure Statement Numbers Selecting this option prevents any procedures from being stored in the file which use statement numbers. Using statement numbers is an obsolete way of coding a User Language procedure which is difficult to understand. If this file is being used to store procedures, select this option in order to enforce proper coding standards. (FOPT=X'80')
    No Procedure Statement Labels Selecting this option prevents any procedures from being stored in the file which use statement labels. Statement labels are the proper way to code a User Language procedure. If this file will be used for storing procedures, enter N or leave the input field blank. Otherwise, enter Y if you want to prohibit procedure statement labels from being assigned to procedure lines. (FOPT=X'40')
    Enable Date Time Stamp The Date Time Stamp is an additional field within the file which tracks changes to a file at the record level and records the date and time of each update to a record. (FOPT=X'10') For details, see Overview of the date-time stamp feature.

    To use the date-time stamp:

    • The file must be an LPU file.
    • The date/time stamp field specified in the DTSFN= system parameter must have already been defined to the file. For details, see Enabling date-time stamp updates.
  11. In the FILE RECOVERY OPTIONS section, select file recovery options for the file. FILEMGMT computes the Model 204 FRCVOPT parameter from your selections and displays the computed value.

    By default, recovery features are enabled. In an online environment, using the default options is recommended so that the file can participate in recovery if the system crashes.

    You might want to turn off recovery options if you are running a batch job that does not need to incur the overhead of recording information for recovery. FILEMGMT provides options to turn off specific recovery features, as described below.

    See File integrity and recovery for details about these options.

    Disable Transaction Backout File does not use the Model 204 transaction back out feature. This option is required if Disable Lock Pending Updates is selected.

    Transaction back out is a feature that will back out an update if the update does not complete as intended. This feature maintains the logical integrity of the file by ensuring that if the commit for an update is not executed, the update will not be kept.

    The default is null.

    (FRCVOPT=X'08')

    No Rollforward (RF) File does not use the roll forward facility of the RESTART command. The default is null. This option prevents the updates from the file from being processed during roll forward. If this option is selected, the file will not participate in roll forward when the system performs recovery.

    (FRCVOPT=X'02')

    No RF Logging Model 204 does not log changes to the journal file. The default is null. Roll Forward logging is the recording of updates from a file that are then used to apply updates when recovery is run. Selecting this option prevents the file from being able to use recovery.

    (FRCVOPT=X'04')

    No Checkpoint (CK) Logging Model 204 does not log checkpoint information to the checkpoint data set. The default is null.

    Checkpoint logging is the process of capturing the contents of a record before an update is made. If checkpoint logging is not active, the file cannot participate in recovery.

    (FRCVOPT=X'20')

    No Updates without RF Logging File is not updated unless roll forward logging is active. The default is null.

    Selecting this option requires that a journal be defined in the environment in which updates are made to the file. If a journal is not available, updates will not be allowed. If updates are made using a batch job, selecting this option will require that the batch job have a journal defined to it that will allow roll forward logging to be performed.

    (FRCVOPT=X'80')

    No Updates Without CK Logging File is not updated unless checkpoint logging is active.The default is null.

    This option requires that a checkpoint data set be defined to the run. Updates will not be allowed unless a checkpoint data set is present. If updates are made using a batch job, the job must have a checkpoint data set.

    (FRCVOPT=X'40')

    All Updates Applied During RF All updates to the file are applied when the file is rolled forward. The default is null.

    This option will apply all updates during roll forward and not back out any incomplete update transactions. This option can only be used if Transaction back out (TBO) is turned off. This can be useful if a large number of updates are made without a commit being issued. It is suggested that after recovery has been run against a file with this option that a REORG be run against this file to ensure that the data and the indexes are in sync.

    (FRCVOPT=X'09')

    No Discontinuities Allowed Only updates that do not result in discontinuities are applied to the file. The default is null.

    A discontinuity is an event that cannot be rolled back past during recovery. It will process the file using the discontinuity as a checkpoint for roll back and roll forward recovery. Essentially, a discontinuity creates a checkpoint for the file in question at the point in time when the discontinuity occurs. There is really no reason not to allow discontinuities.

    (FRCVOPT=X'10')

  12. Format File During CREATE: FILEMGMT formats the file during file creation. Valid values are Y and N. Rocket Software recommends that you use the default value, Y, in order to maintain file integrity.
  13. Verify Disk Updates: FILEMGMT verifies all updates made to the file during file creation. Valid values are Y and N. Rocket Software recommends that you use the default value, N. The computer does its own verification of disk updates, so this option is no longer necessary and likely to cause overhead.

Recreating files

A file recreate is necessary if, for example, you want to increase a table size that cannot be increased in the existing file. Recreating a file deletes all the data and procedures in the file, but leaves the field, record, and field group definitions intact. To preserve the data and procedures, you must dump or display the files and procedures. You cannot recreate a file from the primary screen, which has entities staged with commands.

To recreate a file:

Select the File Maintenance Recreate function from one of the following:

  • Primary screen if the file is an existing file.
  • File Size Definition screen if the file is existing or staged, and if the sizing calculations show some tables are so large that the file needs to be recreated. (See Sizing an existing file.)

When you select the Recreate function, FILEMGMT creates a version of all field, record, and field group definitions and stages them for DEFINE. The steps for recreating a file are thereafter similar to the steps for creating a file described in Overview of creating files.

The Recreate function uses the same Definition screens as the CREATE function.

You can select the Size function to resize the file after you redefine the file on the Definition screens.