Defining fields with FILEMGMT

From m204wiki
Revision as of 17:03, 12 May 2014 by ELowell (talk | contribs)
Jump to navigation Jump to search

Prerequisite: Read the field naming conventions, field attributes, and field design pages.

FILEMGMT provides you with an interface to perform all your field maintenance operations. This section describes how to perform the following operations:

  • List fields in new and existing files.
  • Select the fields you want to define, redefine, delete, and rename.
  • Define and redefine the attributes of fields.
  • Stage fields in preparation for executing DEFINE, REDEFINE, DELETE, and RENAME commands.
  • Copy fields and records.

Field Name List screen

To display the Field Name List screen, choose one of the following methods:

  • Press the F4 (FIElds) key on a File Definition screen or the File Size Definition screen. FILEMGMT displays the File Name List screen in DEFINE mode.
  • Select a Field maintenance function from the primary screen without specifying a particular field name. FILEMGMT displays the File Name List screen in the mode corresponding to the selected function.

Use the Field Name List screen to:

  • Specify the names of the fields in a file you are creating.
  • View fields in an existing file, define additional fields, and select fields you want to redefine, delete, and rename.

If you are defining new fields for a new or existing file, FILEMGMT displays the Field Name List screen in DEFINE mode:

FILEMGMT Field Name List Line 1 of 12 Enter and select with an 'X' the fields you want to DEFINE to the file Filename: VEHICLES | Fieldname Cmd -------------------------------------------------------------------------- X MY DATE TIME STAMP FIELD NAME CONTAINING SPACES _ ______________________________________________________________________ _ ______________________________________________________________________ _ ______________________________________________________________________ _ ______________________________________________________________________ _ ______________________________________________________________________ _ ______________________________________________________________________ _ ______________________________________________________________________ _ ______________________________________________________________________ _ ______________________________________________________________________ _ ______________________________________________________________________ _ ______________________________________________________________________ ===> 1=HELp 2=DOCument 3=QUIt 4=FILe 5= 6=COMmands 7= 8=FORward 9=RECords 10= 11=ATTributes 12=END

In this screen, the field name list is empty, showing that no fields are defined for the file. You can type the names of fields you want to define for the file, one field per line.

If the Update Date and Time Stamp file option is set to Y on the File Definition - Organization screen, then when you navigate to the Field Name List screen, the value from the Date Time Stamp Field Name (DTSFN) parameter is placed as the first field on the Field Name List screen.

According to the Date Time Stamp function description:

  • The DTSFN field name is required for all files that use the date/time stamp feature.
  • The default value for DTSFN is: MY DATE TIME STAMP FIELD NAME CONTAINING SPACES

If you are redefining, deleting, or renaming fields, and you do not specify a particular field name on the primary screen, FILEMGMT displays the Field Name List screen in the mode corresponding to the requested function.

The following screen was invoked by selecting the REDEFINE function:

FILEMGMT Field Name List Line 1 of 4 Select the fields you want to REDEFINE with an 'X' Filename: ABC | Fieldname Cmd ----------------------------------------------------------------------- _ EMPLOYEE FIRST NAME _ EMPLOYEE ID _ EMPLOYEE INITIAL _ EMPLOYEE LAST NAME ===> 1=HELp 2=DOCument 3=QUIt 4=FILe 5= 6=COMmands 7= 8= 9=RECords 10= 11=ATTributes 12=END

Staged fields display the command for which they are staged in the Cmd column. Nonstaged fields have a blank in the Cmd column, as in the previous screen. Staging is discussed in Staging entries.

You can scroll forward and backward to view additional field names by pressing the F8 (FORward) and F7 (BACkward) keys. You can scroll forward 4000 lines, which corresponds to the maximum number of field names in Table A of a file.

If you specified a particular field name when you selected a Define or Redefine from the primary screen, FILEMGMT does not display this screen. Instead, FILEMGMT proceeds directly to the Field Attributes screen. For Rename and Delete, you must go to this screen first before proceeding to the Field Attributes screen.

When updates on this screen are saved, the fields are displayed in sorted order when the screen is reentered.

Field Name List screen input

FILEMGMT displays or prompts you for the following information:

Prompt Response
Filename FILEMGMT displays the name of the file that you entered on the primary screen.
Fieldname If you are creating a new file for which no fields have been defined, the Fieldname lines are blank.

If you are viewing an existing file and did not specify a particular field name on the primary screen, FILEMGMT lists all the fields in the file.

Follow these steps to stage fields for a particular function.

To define fields:

  1. If the field names are new, type in the names (1-70 characters). Use the standard Model 204 field naming conventions. If the field names already exist, type X to the left of the field names.

    You can remove field names that you just added to the Field Name List screen by typing D to the left of the newly entered names. Newly entered names display three asterisks (***) in the Cmd area if you press Enter.

  2. Press F11 (ATTributes).

    The Field Attributes screen displays the fields you selected in the order in which they are listed on the Field Name List screen. The fields are staged for DEFINE with default attributes.

To redefine fields:

  1. Select Redefine field from the main menu.
  2. Type X to the left of the field names to select them.
  3. Press F11 (ATTributes).

    The Field Attributes screen displays the fields you selected in the order in which they are listed on the Field Name List screen. The fields are staged for REDEFINE.

To delete fields:

  1. Select Delete field from the main menu.
  2. Type X to the left of the field names to select them.
  3. Press one of the following to stage the fields for DELETE:

    F2 (DOCument) F4 (FILe) F6 (COMmands) F9 (RECords) F11 (ATTributes) F12 (END) F3 (QUIt) to cancel the deletion

    Requesting a field deletion may generate a REDEFINE command for each record that the field cross-references. Each record's average length is decreased by the field's average length multiplied by the field percent rate for the record.

To rename fields:

  1. Select Rename Field from the main menu.
  2. Type over the existing names.
  3. Type X to the left of the field names to select them.
  4. Press one of the following to stage the fields for RENAME:

    F2 (DOCument) F4 (FILe) F6 (COMmands) F9 (RECords) F11 (ATTributes) F12 (END) F3 (QUIt) to cancel the operation

Cmd Displays the status of the field shown on the line.

If the field is currently staged, FILEMGMT displays the command that was generated for the field. The command is one of the following:

***Field name is new.
DEFField is being defined.
REDField is being redefined.
DELField is being deleted.
RENField is being renamed.
R/RField is being redefined and renamed.

Field operations might be staged if you begin to define, redefine, delete, or rename fields and then end your FILEMGMT session without executing the commands that were generated. When you begin a new session, these fields are shown as being staged.

If the field is not currently staged, this column is blank.

If a field name is added during a DEFINE operation and you press Enter, this column contains three asterisks (***).

A field's Cmd status determines whether you can issue a particular command for the field. The table in summarizes your options; an X indicates the command is valid for the field.

Field Name List screen commands

To issue a command, press a PF key or type a command name at the prompt (===>) and press Enter.

Key Command Meaning
F1 HELp Displays Help text for the Field Name List screen.
F2 DOCument Invokes the Dictionary/204 Documentation facility. Place the cursor over the field name that you want to document and press F2. Changes to the Field Name List screen are saved in the dictionary.
F3 QUIt Exits from the Field Name List screen and returns to the previous screen without making any changes.
F4 FILe Proceeds to the File Definition - Organization screen, if the file is new. Proceeds to the File Parameter Reset screen, if the file already exists. Changes to the Field Name List screen are saved in the dictionary.
F6 COMmands Proceeds to the Execute Commands screen. This screen displays the staged commands that were generated for the file and allows you to select the commands you want to execute. Changes to the Field Name List screen are saved in the dictionary.
F7 BACkward Scrolls backward one screen. If you type BAC at the prompt (===>), followed by a number, FILEMGMT scrolls backward the specified number of lines.
F8 FORward Scrolls forward one screen. If you type FOR at the prompt (===>), followed by a number, FILEMGMT scrolls forward the specified number of lines.
F9 RECords Proceeds to the Record Name List screen. This screen lists the records in the file. Changes to the Field Name List screen are saved in the dictionary.
F11 ATTributes Proceeds to the Field Attribute screen. This screen defines attributes for the fields you just selected from the list. Changes to the Field Name List screen are saved in the dictionary.

When you return from the Field Attributes screen, the Xs you originally entered on the Field Name List screen:

  • Are removed from the prefix area of fields that were processed by pressing F11 (NEXtfld), or F12 (END) on the Field Attributes screen.
  • Remain in the prefix area of fields that were not processed.
F12 END Exits from the Field Name List screen and returns to the FILEMGMT primary screen. Changes to the Field Name List screen are saved in the dictionary.

Retaining field names when initializing the file

The File Initialize screen enables you to keep field definitions (using KEEPDEFS) when the file is initialized.

  1. Enter the file name on the primary screen.
  2. Select the INITIALIZE command.
  3. Press Enter.

The File Initialize screen is displayed:

FILEMGMT File Initialize Screen FILENAME: ABC Keep Field Definitions? N Inactive FICREATE: 6.1 FILEORG: Entry Order PAGESZ: 6184 ASIZE: 3 BSIZE: 15 DSIZE: 4 ESIZE: 0 PROCS ------------ ------------ ------------ ------------ ---------- ASTRPPG: 614 BRECPPG: 256 DRESERVE: 15 % EHIGHPG: CUR: 0 ATRPG: 1 BRESERVE: 17 PDSIZE: 1 EXP: 0 FVFPG: 1 RECS: 1000 PDSTRPPG: 128 AVPG: 1 MVFPG: 1 DPGSRES: 2 CSIZE: 1 FREESIZE: Total Space Pages: 5049 DDname Dataset Name ( 1 of 1 ) Device Trks/Blks ABC M204.ABC 3390 632 ===> FIM015 Use PF3 to cancel the DELETE Command or PF6/PF12 to process 1=HELp 2= 3=QUIt 4= 5= 6=COMmands 7= 8= 9= 10= 11= 12=END

The File Initialize screen duplicates the information on the File Size Definition screen.

The screen has only one input field: Keep Field Definitions?. N is the default. If you change it to Y, the INITIALIZE command is generated with the KEEPDEFS option which retains the field names when the file is initialized. After deciding whether to keep the field definitions, you can select one of the File Initialize commands in the following subsection.

File Initialize screen commands

To issue a command, press a PF key or type a command name at the prompt (===>) and press Enter.

Key Command Meaning
F1 HELp Displays Help text for the File Initialize screen.
F3 QUIt Exits from the File Initialize screen and returns to the primary screen without making any changes.
F6 COMmands Stages the file for INITIALIZE. Proceeds to the Execute Commands screen. This screen displays the staged commands that were generated for the file and allows you to select the commands you want to execute.
F12 END Stages the file for INITIALIZE. Exits from the File Initialize screen and returns to the primary screen.