HP 3000 Manuals

File Section (Cont.) [ Micro Focus COBOL Language Reference ] MPE/iX 5.0 Documentation


Micro Focus COBOL Language Reference

File Section (Cont.) 

The VALUE OF Clause 

Function.   

The VALUE OF clause specifies the description of an item in the label
records associated with a file.

For ANS85 only:  The VALUE OF clause of the file description entry is
classed as an obsolete element in the ANSI'85 standard and is scheduled
to be deleted from the next full revision of the ANSI Standard.

For MF only:    All dialects in this COBOL implementation fully support
this syntax.  Refer to your COBOL System Reference for details on using
the FLAGSTD directive to detect all occurrences of this syntax.

For XOPEN only:  Although it is a part of the standard COBOL definition,
this feature is explicitly excluded from the X/Open COBOL language
definitions and should not be used in a conforming X/Open COBOL source
program.

General Formats.   

Format 1 (All Files).   

[]
For MF only: Format 2 (All Files).
[]
Syntax Rules. Format 1 (All Files). 1. Data-name-1 should be qualified when necessary but cannot be subscripted or indexed, nor can it be an item described with the USAGE IS INDEX clause. 2. Data-name-2 must be in the Working-Storage Section. For MF only: Format 2 (All Files). 3. Literal-2 must be a nonnumeric literal and cannot be a figurative constant. 4. The VALUE OF FILE-ID clause cannot be used if external-file-reference, data-name-2 or literal-2 has been specified in the ASSIGN clause in the File-Control Entry (see the section The File-Control Entry earlier in this chapter). General Rules. Format 1 (All Files). 1. For MF only: This clause is documentary only. 2. A figurative constant can be substituted wherever a literal is specified. For MF only: Format 2 (All Files). 3. The character-string specified in literal-2 or data-name-2 is taken as the external file-name. For MF and XOPEN only: Screen Section The Screen Section provides screen handling facilities for use with ACCEPT and DISPLAY statements. It allows: * the display of non-scrolling forms consisting of areas of the screen as defined in the Screen Section. A screen section entry is called a screen description. It is similar in appearance to a data description but defines a screen item or area of the screen rather than an area in memory. * For MF only: the display of data items which constitute non-scrolling forms. The details of the areas of the screen to be used are provided in the associated ACCEPT and DISPLAY operations. The Screen Section contains a description of each field on the screen which is accessed in a Format 4 ACCEPT or Format 2 DISPLAY operation. Such a field is called a screen item. Many screen items describe only the layout of fields within a field on the screen and are never referenced explicitly. The Screen Section contains syntax which enables the operator to: * specify the exact location of fields * accept data typed at specified positions * display literal text at specified positions * define screen attributes * control console features. Table 4-6. summarizes the screen description clauses, screen options and data description clauses available in the Screen Section and for use with ACCEPT and DISPLAY statements. (MF) It also specifies options or clauses which can be used with each of the types of fields defined below: * An input field is a screen item whose description contains a TO phrase. * An output field is a screen item whose description contains a FROM phrase. * An update field is a screen item whose description contains a USING phrase. * A literal field is an elementary screen item whose description contains no PICTURE clause. Data entry is made to numeric and numeric edited screen fields in two ways; fixed format mode and free format mode. Refer to your COBOL System Reference for further details. Fixed format mode is the default manner in which data entry is made to numeric and numeric edited screen fields. This mode formats and echoes the entered data and also moves the cursor in accordance with the requirements of the field's picture specification, as each keystroke is received. Characters other than digits, "+", "-" , and the decimal point character, are rejected; insertion characters in edited fields are skipped over as the cursor moves backwards and forwards; any sign indicator is modified in accordance with its normal specification; floating symbols move left and right in the field, and insertion symbols appear and disappear as digits are inserted or deleted. When the cursor reaches the last character position in a field, any further character entered replaces the last character. Free format mode is an alternative manner in which data entry can be made to numeric and numeric edited screen fields. The default mode is fixed format mode (see above entry). This configurable mode allows data to be keyed into a PIC X field of appropriate length, and only when the operator leaves the field is the data reformatted to comply with the picture specification. Once the operator moves the cursor from the field, your COBOL system disregards all characters other than digits and the sign and decimal point symbols. It then extracts, stores, or reformats the numeric value in accordance with the normal COBOL rules for a MOVE to an item with the same picture as the screen item or working-storage item. The numeric value is then usually echoed to the screen. See your COBOL System Reference for details on configuration options available to you. Table 4-6 : Permitted Use of Options(MF and XOPEN only) -------------------------------------------------------------------------- | | | | | Screen | SCREEN SECTION | WITH PHRASE(MF) | | Clauses/ | | | | Screen | | | | Options | | | | Data | | | | Description | | | | Clauses | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | | Input | Output | Update | Literal| ACCEPT | DISPLAY | | | Field | Field | Field | Field | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | AUTO | X | | X | | X | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | BACKGROUND- | X | X | X | X | X | X | | COLOR | | | | | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | BELL | X | X | X | X | X | X | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | BLANK | X | X | X | X | | X | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | BLANK WHEN | X | X | X | | | | | ZERO | | | | | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | BLINK | X | X | X | X | X | X | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | COLUMN | X | X | X | X | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | ERASE | X | X | X | X | X | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | FOREGROUND- | X | X | X | X | X | X | | COLOR | | | | | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | FULL | X | | X | | X | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | GRID | X | X | X | X | X | X | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | HIGHLIGHT | X | X | X | X | X | X | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | JUSTIFIED | X | X | X | | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | LEFT-JUSTIFY | | | | | X | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | LEFTLINE | X | X | X | X | X | X | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | LINE | X | X | X | X | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | LOWLIGHT | X | X | X | X | X | X | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | OCCURS | X | X | X | | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | OVERLINE | X | X | X | X | X | X | | | | | | | | | -------------------------------------------------------------------------- Table 4-6 : Permitted Use of Options(MF and XOPEN only) (Continued) -------------------------------------------------------------------------- | | | | | Screen | SCREEN SECTION | WITH PHRASE(MF) | | Clauses/ | | | | Screen | | | | Options | | | | Data | | | | Description | | | | Clauses | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | | Input | Output | Update | Literal| ACCEPT | DISPLAY | | | Field | Field | Field | Field | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | PROMPT | X | | X | | X | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | REQUIRED | X | | X | | X | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | REVERSE- | X | X | X | X | X | X | | VIDEO | | | | | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | RIGHT- | | | | | X | | | JUSTIFY | | | | | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | SECURE | X | | X | | X | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | SIGN | X | X | X | | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | SIZE | X | X | X | X | X | X | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | SPACE-FILL | | | | | X | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | TRAILING- | | | | | X | | | SIGN | | | | | | | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | UNDERLINE | X | X | X | X | X | X | | | | | | | | | -------------------------------------------------------------------------- | | | | | | | | | UPDATE | | | | | X | | | | | | | | | | -------------------------------------------------------------------------- X = clause/option allowed These clauses and options are described in the following sections. Function. The Screen Section provides screen handling facilities for use with Format 4 ACCEPT and Format 2 DISPLAY statements. General Format.
[]
Syntax Rules. 1. The Screen Section must be the last section in the Data Division. 2. Screen-description-entries contain screen description clauses. Data description clauses allowed in the Screen Section are restricted to those shown in the General Format. General Rule. The Screen Section contains a description of each field on the screen which is accessed in a Format 4 ACCEPT or Format 2 DISPLAY operation. Such a field is called a screen item. Many screen items describe only the layout of fields within a field on the screen and are never referenced explicitly. For MF and XOPEN only: The Screen Description - Complete Entry Skeleton Function. A Screen Description entry specifies the attributes, behavior, size and location for a referenced screen item which is accepted or displayed at run time. The availability of screen attributes is dependent on your terminal hardware and operating system and COBOL run-time support. For MF only: The following are not a part of X/Open screen handling: ACCEPT (Formats 3 and 5) AUTO-SKIP (synonym for AUTO) BEEP (synonym for BELL) COL (synonym for COLUMN) CONTROL DISPLAY (Format 3) EMPTY-CHECK (synonym for REQUIRED) GRID LEFTLINE LENGTH-CHECK (synonym for FULL) NO-ECHO (synonym for SECURE) OCCURS OVERLINE PROMPT SIZE ZERO-FILL General Format.
[]
(Continued on next page)
[]
Syntax Rules. 1. Each Screen Description entry must start with a level number from 01 through 49. 2. Each level 01 item must have a screen-name. 3. Screen-name assigns a name to the screen item described in the screen description. Screen-name immediately follows level number, conforming to the rules for user-defined names. 4. A screen item can be referenced only in a Format 4 ACCEPT or Format 2 DISPLAY statement. 5. Each elementary screen item must contain at least one of the following clauses: BELL, BLANK LINE, BLANK SCREEN, COLUMN, LINE, PICTURE, VALUE. 6. The data items in the FROM, TO and USING phrases are "associated" with the screen item. The USING phrase is equivalent to the combination of a FROM and TO phrase, each specifying the same field. 7. An ACCEPT can be executed on a group screen item containing screen items with FROM or VALUE phrases only if that group also contains screen items with TO or USING phrases. 8. The clauses following screen-name can be specified in any order. 9. A clause that appears in the description of a group screen item applies to all the elementary subordinate items in that group in whose descriptions it would be allowed. 10. Any non-01 level screen item can have a data name, FILLER, or no name. If no name is used, then FILLER is assumed (and the item can never be explicitly referenced). 11. If the same clause is specified more than once for the same screen item, the clause which appears at the lowest level within the hierarchy is the one which takes effect. General Rules. 1. Screen descriptions define areas on the screen. Each entry consists of a level number, an optional screen-name, and various optional clauses relating to the positioning of fields as well as to console functions. 2. When the screen item is displayed, data is taken from the literal or data item named in the associated FROM or USING phrase. Items within the TO phrase only are treated as though FROM SPACE or FROM ZERO were specified, depending on the type of screen item. 3. When the screen item is accepted, the data entered is moved from the screen to the data item named in the TO or USING phrase. Depending on the category of the item, conversion and de-editing are done if necessary. 4. An input field is a screen item whose description contains a TO phrase. 5. An output field is a screen item whose description contains a FROM phrase. 6. An update field is a screen item whose description contains a USING phrase. 7. A literal field is an elementary screen item whose description contains no PICTURE clause. 8. An ACCEPT of a group screen item consists of accepting those elementary subordinate items that are input or update fields. They are accepted in the order their descriptions appear in the Screen Section at the screen positions indicated by the screen descriptions. Unless otherwise specified in the CURSOR IS clause (see the section The CURSOR IS Clause earlier in this chapter), the cursor is initially positioned at the start of the first item. As the ACCEPT operation into each item is terminated, the cursor moves to the start of the next item. 9. A DISPLAY of a group screen item consists of displaying those elementary subordinate items that are output, update or literal fields. They are displayed simultaneously at the screen positions indicated by the screen descriptions. 10. If the length of an ACCEPT or DISPLAY screen item exceeds the length of the current line, wraparound is to the next line. 11. If a screen item is too large to fit within the physical screen, truncation occurs at the first character that is off-screen for output fields and alphanumeric input and update fields, and at the first field that is off-screen for numeric and numeric edited input and update fields. For MF and XOPEN only: The AUTO Clause Function. The AUTO clause automatically terminates an ACCEPT operation of the screen item when the last character position is keyed. No explicit terminator key is necessary. General Format.
[]
Syntax Rules. 1. The AUTO clause is allowed only with input and update fields. 2. If this clause is specified at group level, it applies to all elementary subordinate items. 3. For MF only: AUTO and AUTO-SKIP are equivalent. General Rules. 1. Provided any REQUIRED or FULL clause is satisfied, the cursor is positioned to the next screen item. Alternatively, if the screen item is the last one in the ACCEPT operation, the entire ACCEPT is terminated. 2. This clause overrides any existing configuration options for automatic skipping and for the automatic termination of an ACCEPT statement. (See your COBOL System Reference for details of configuration options.) 3. In a fixed format numeric edited screen item, the AUTO clause causes the decimal point position to be skipped automatically once all of the integer places have been filled. Selection of fixed format mode is a configuration option. (See your COBOL System Reference for details of configuration options.) For MF and XOPEN only: The BACKGROUND-COLOR Clause Function. The BACKGROUND-COLOR clause specifies the background color of the screen item. General Format.
[]
Syntax Rules. 1. For MF only: BACKGROUND-COLOR and BACKGROUND-COLOUR are equivalent. 2. This clause is allowed with any screen item. 3. If this clause is specified at group level, it applies to all elementary subordinate items. 4. Integer-1 must be a value from 0 to 7. General Rules. 1. This clause is available for use only with a color screen. 2. Integer-1 or identifier-1 specifies the background color of the screen item. The colors and their corresponding values are: 0 black 1 blue 2 green 3 cyan 4 red 5 magenta 6 brown or yellow 7 white 3. If this clause is not specified, the background color defaults to black. 4. If a screen description contains a BLANK SCREEN clause, and either contains a BACKGROUND-COLOR clause or is subordinate to one that does, when the screen item is displayed by a DISPLAY statement the specified color becomes the default background color. It remains the default background color until either another screen item with this combination of options is displayed (whether in the same DISPLAY statement or another), or a Format 3 DISPLAY statement with both options is executed. 5. Identifier-1 must be an unsigned numeric integer and should contain a value between 0 and 7. Any value higher than 7 will be divided by 8 and the remainder used as the color value. 6. Identifier-1 must not be subject to OCCURS clauses. 7. Whether a value of 6 in integer-1 or identifier-1 produces brown or yellow color depends on the terminal hardware. For MF and XOPEN only: The BELL Clause Function. The BELL clause causes an audible alarm to occur each time the item containing the clause is displayed. In order to cause the audible alarm to sound when the clause is accepted, you must define the BELL clause in General Format 5 of the ACCEPT statement: the alarm will not sound if you define the BELL clause in the Screen Description Entry and then use General Format 4 of the ACCEPT statement. General Format.
[]
Syntax Rules. 1. This clause is allowed only with elementary items. 2. For MF only: BELL and BEEP are equivalent. General Rule. The BELL clause causes an alarm to occur each time the item containing the clause is accepted or displayed. For MF and XOPEN only: The BLANK Clause Function. During a DISPLAY operation, each subsidiary item within a screen-name is displayed according to source sequence. When an item with BLANK LINE is encountered, the line is cleared to spaces from the beginning of the line to the end of the line. The cursor remains in the same position as before the BLANK LINE was actioned. When an item with BLANK SCREEN is encountered, the entire screen is cleared to spaces and the cursor repositioned to line 1, column 1. General Format.
[]
Syntax Rules. 1. The BLANK SCREEN clause can be specified in any screen description entry. 2. The BLANK LINE clause can be specified only for elementary items. General Rules. 1. The BLANK SCREEN clause is executed before DISPLAY of a screen data item, no matter where it appears. If the clause is specified, all the screen is cleared and the cursor is placed at line 1, column 1. 2. When BLANK LINE is specified, blanking begins at column 1 of the line specified for the screen data element in whose description it is included and continues through the end of the line. 3. If neither the BLANK nor the ERASE clause is specified, only the particular character positions corresponding to the screen data element are modified when the element is displayed. The rest of the screen content remains the same. 4. The BLANK SCREEN clause causes the screen to return to its default foreground and background colors. For additional effects, if the screen item is subject to a FOREGROUND-COLOR or BACKGROUND-COLOR clause, see the sections on those clauses. 5. The BLANK clause is ignored in an ACCEPT statement. 6. The erasing is done before the item is displayed. 7. When the BLANK SCREEN clause is used, only color options (foreground-color and background-color) should be used on the same screen. Other attributes will be accepted but ignored.


MPE/iX 5.0 Documentation