Defining fields with FILEMGMT: Difference between revisions
No edit summary |
m (Admin moved page Defining Fields with FILEMGMT to Defining fields with FILEMGMT) |
(No difference)
|
Revision as of 17:31, 13 December 2013
Prerequisite: Read the chapers on field naming conventions, field attributes, and field design.
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
To display the Field Name List Screen, choose one of the following methods:
- Press the PF4 (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 PF8 (FORward) and PF7 (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:
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. Press PF11 (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:
Press PF11 (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:
Press one of the following to stage the fields for DELETE: PF2 (DOCument) PF4 (FILe) PF6 (COMmands) PF9 (RECords) PF11 (ATTributes) PF12 (END) PF3 (QUIt) to cancel the deletion |
Fieldname (continued) |
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:
Type X to the left of the field names to select them. Press one of the following to stage the fields for RENAME: PF2 (DOCument) PF4 (FILe) PF6 (COMmands) PF9 (RECords) PF11 (ATTributes) PF12 (END) PF3 (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. DEF Field is being defined. RED Field is being redefined. DEL Field is being deleted. REN Field is being renamed. R/R Field 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 |
---|---|---|
PF1 | HELp | Displays HELP text for the Field Name List screen. |
PF2 | DOCument | Invokes the Dictionary/204 Documentation facility. Place the cursor over the field name that you want to document and press PF2. Changes to the Field Name List screen are saved in the dictionary. |
PF3 | QUIt | Exits from the Field Name List screen and returns to the previous screen without making any changes. |
PF4 | 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. |
PF6 | 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. |
PF7 | BACkward | Scrolls backward one screen. If you type BAC at the prompt (===>), followed by a number, FILEMGMT scrolls backward the specified number of lines. |
PF8 | FORward | Scrolls forward one screen. If you type FOR at the prompt (===>), followed by a number, FILEMGMT scrolls forward the specified number of lines. |
PF9 | 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. |
PF11 | ATTributes |
Proceeds to the Field Attributes 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:
|
PF12 | END | Exits from the Field Name List screen and returns to the 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.
- Enter the file name on the primary screen.
- Select the INITIALIZE command.
- 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. The default is N. 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 following File Initialize commands.
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 |
---|---|---|
PF1 | HELp | Displays HELP text for the File Initialize screen. |
PF3 | QUIt | Exits from the File Initialize screen and returns to the primary screen without making any changes. |
PF6 | 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. |
PF12 | END | Stages the file for INITIALIZE. Exits from the File Initialize screen and returns to the primary screen. |