PreviousData Division - Data Description Procedure DivisionNext

Chapter 9: Data Division - Screen Section

9.1 Screen Section

9.1.1 Screen Section

The Screen Section provides screen handling facilities for use with ACCEPT and DISPLAY statements. It allows the following:

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:

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. It also specifies options or clauses which can be used with each of the types of fields defined below:

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 documentation about user interfaces 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). Free format 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 documentation about user interfaces for details on configuration options available to you.

Table 4-6: Permitted Use of Options

Screen Clauses/
Screen Options/
Data Description
Clauses
SCREEN SECTION WITH PHRASE
Input Field Output Field Update Field Literal Field ACCEPT DISPLAY
AUTO X   X   X  
BACKGROUND-COLOR X X X X X X
BELL X X X X X X
BLANK X X X X   X
BLANK WHEN ZERO X X X      
BLINK X X X X X X
COLUMN X X X X    
ERASE X X X X X  
FOREGROUND-COLOR X X X X X X
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
PROMPT X   X   X  
REQUIRED X   X   X  
REVERSE-VIDEO X X X X X X
RIGHT-JUSTIFY         X  
SECURE X   X   X  
SIGN X X X      
SIZE X X X X X X
SPACE-FILL         X  
TRAILING-SIGN         X  
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.

9.1.1.1 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.

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

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 must immediately follow level number and conform 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-name assigns a name to the screen item described in the screen description.

  2. 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.

  3. When the screen item is displayed, data is taken from the literal or data item named in the associated FROM or USING phrase. Items with the TO phrase only are treated as though FROM SPACE or FROM ZERO were specified, depending on the type of screen item.

  4. 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.

  5. An input field is a screen item whose description contains a TO phrase.

  6. An output field is a screen item whose description contains a FROM phrase.

  7. An update field is a screen item whose description contains a USING phrase.

  8. A literal field is an elementary screen item whose description contains no PICTURE clause.

  9. 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.

  10. 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.

  11. If the length of an ACCEPT or DISPLAY screen item exceeds the length of the current line, wraparound is to the next line.

  12. 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.

9.1.1.2 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. 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 documentation about user interfaces 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 documentation about user interfaces for details of configuration options.)

9.1.1.3 The BACKGROUND-COLOR Clause

Function

The BACKGROUND-COLOR clause specifies the background color of the screen item.

General Format

Syntax Rules

  1. 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.

9.1.1.4 The BELL Clause

Function

The BELL clause causes an audible alarm to occur each time the item containing the clause is displayed.

General Format

Syntax Rules

  1. This clause is allowed only with elementary items.

  2. BELL and BEEP are equivalent.

General Rules

  1. The BELL clause causes an alarm to occur each time the item containing the clause is accepted or displayed.

  2. In order to cause the audible alarm to sound when the subject of this entry is accepted, you must specify the BELL clause in General Format 5 of the ACCEPT statement: the alarm will not sound if you specify the BELL clause in the Screen Description Entry and then use General Format 4 of the ACCEPT statement.

9.1.1.5 The BLANK Clause

Function

The BLANK clause clears a line of a screen or the whole screen before a screen item is displayed.

General Format

Directives

  1. In addition to Compiler directives which provide flagging and modify the reserved word list, the following directive may impact either the syntax or semantics described in this section.

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. The cursor remains in the same position as before the BLANK LINE was actioned.

  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.

9.1.1.6 The BLANK WHEN ZERO Clause in the Screen Section

Function

The BLANK WHEN ZERO clause causes the blanking of a screen item when its value is zero.

General Format

Syntax Rules

  1. This clause is allowed only with input, output and update fields that are numeric or numeric edited.

General Rules

  1. The BLANK WHEN ZERO clause causes the blanking of a screen item when its value is zero.

  2. This clause has no effect when the cursor is in the field. That is, the contents of the field are always displayed, even if zero, if this is the current input field.

9.1.1.7 The BLINK Clause

Function

The BLINK clause causes the screen item to blink when it appears on
the screen.

General Format

Syntax Rules

  1. The BLINK clause is allowed with any screen item.

  2. If the BLINK clause is specified at group level, it applies to all suitable subordinate elementary items.

General Rules

  1. The BLINK clause causes the screen item to blink when it appears on the screen.

9.1.1.8 The COLUMN Clause

Function

The COLUMN clause specifies the column at which the screen item starts on the screen.

General Format

Syntax Rules

  1. Identifier-1 must be an unsigned numeric integer and must contain a value greater than zero and less than 256.

  2. Integer-1 must be unsigned, greater than zero and less than 256.

  3. PLUS and "+" are equivalent.

  4. Omitting the NUMBER phrase results in a default value of +1.

  5. COLUMN 1 is assumed for screen descriptions which specify the LINE clause but omit the COLUMN clause.

  6. The COLUMN clause can be specified with any elementary item.

  7. COL is an abbreviation for COLUMN.

  8. When the COLUMN clause is specified anywhere within the hierarchy of a SCREEN SECTION group item, then at least one of the following clauses must also be specified within the same group definition:

    BEEP, BELL, BLANK LINE, BLANK SCREEN, ERASE EOL, ERASE EOS, FROM, TO, USING, or VALUE.

General Rules

  1. The COLUMN clause specifies the column in which the screen item is to appear on the screen in an ACCEPT or DISPLAY operation.

  2. If the COLUMN clause has an identifier or an integer but does not specify PLUS,

    "+" or "–",

    the clause gives an absolute column number within the screen record. Each 01 level represents a screen record. The AT phrase of the ACCEPT and DISPLAY statements specifies the positioning of the screen record relative to the start of the display screen. If the AT phrase is not specified, then column 1 is the first column on the screen.

  3. If PLUS,

    "+" or "–"

    is specified in the COLUMN clause, then the column number within the screen record is relative to that at which the preceding screen item ends, regardless of whether or not the statement displays the preceding item on the screen. This depends on the current effective length of that item at run time, derived from its PICTURE, VALUE and SIZE clauses. The counting of column numbers restarts at a level 01 item at column 1.

  4. If a screen description contains neither a LINE or COLUMN clause, and the item is not a level 01 item, COLUMN+1 is assumed. The item then starts immediately following the preceding item in the Screen Section.

  5. If a COLUMN position that is specified is off the screen, wraparound is to the next (or previous) line.

9.1.1.9 The CONTROL Clause

Function

The CONTROL clause allows attributes associated with a Screen Section item to be defined at run time.

General Format

Syntax Rules

  1. This clause is allowed with any screen item.

  2. If this clause is specified at group level, it applies to all elementary subordinate items.

  3. Identifier-1 must be an alphanumeric data item. The maximum permitted size of the item is PIC X(65535).

  4. Attributes specified in identifier-1 override any statically defined attributes.

  5. CONTROL statements must not be nested.

  6. The PROTECT attribute may be specified only for an elementary screen description entry.

General Rules

  1. When an ACCEPT or DISPLAY statement is executed that implicitly or explicitly references the subject of this entry, the contents of the data item referenced by identifier-1 must conform to the following subset of the screen attributes which can be specified elsewhere:

  2. If identifier-1 contains spaces, the statically defined attributes are used for any accept or display of the item.

  3. The meaning of each of the attributes that can be specified within the CONTROL identifier-1 is defined in the following parts of this reference:

    1. Within the DATA DIVISION as an individual SCREEN SECTION CLAUSE

      • AUTO-SKIP/AUTO
      • BACKGROUND-COLOR/BACKGROUND-COLOUR
      • BELL/BEEP
      • BLANK LINE/SCREEN
      • BLINK
      • FOREGROUND-COLOR/FOREGROUND-COLOUR
      • FULL/LENGTH-CHECK
      • GRID
      • HIGHLIGHT
      • JUSTIFY/JUST
      • LEFTLINE
      • LOWLIGHT
      • OVERLINE
      • PROMPT
      • REQUIRED/EMPTY-CHECK
      • REVERSE-VIDEO
      • SECURE/NO-ECH0
      • UNDERLINE
      • ZERO-FILL

    2. Within the PROCEDURE DIVISION in the ACCEPT statement General Rules:

      • RIGHT-JUSTIFY
      • TRAILING-SIGN
      • TRAILING

    3. Within this CONTROL clause discussion:

      • PROTECT

  4. The PROTECT attribute specifies that input to an ACCEPT item is to be prevented.

9.1.1.10 The ERASE Clause

Function

The ERASE clause clears part of the line or the screen starting at the cursor position.

General Format

Syntax Rules

  1. The ERASE clause can be specified only for elementary items.

General Rules

  1. When ERASE EOL is specified, blanking begins at the line and column coordinates specified for the screen data element in whose description it is included and continues through the end of the line.

  2. When ERASE EOS is specified, blanking begins at the line and column coordinates specified for the screen data element in whose description it is included and continues through the end of the screen.

  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.

  4. The clause is ignored in an ACCEPT operation.

9.1.1.11 The FOREGROUND-COLOR Clause

Function

The FOREGROUND-COLOR clause specifies the foreground color of the screen item.

General Format

Syntax Rules

  1. FOREGROUND-COLOR and FOREGROUND-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 foreground 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 foreground color defaults to white.

  4. If a screen description contains a BLANK SCREEN clause, and either contains a FOREGROUND-COLOR clause or is subordinate to one that does, then when the screen item is displayed by a DISPLAY statement the specified color becomes the default foreground color. It remains the default foreground 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. If the HIGHLIGHT clause is also specified, foreground colors are brightened and lightened; for example on some hardware, black can become grey and brown can become yellow. However, this does not apply to the BLANK SCREEN clause.

  6. 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.

  7. Identifier-1 must not be subject to OCCURS clauses.

  8. Whether a value of 6 in integer-1 or identifier-1 produces brown or yellow depends on the terminal hardware.

9.1.1.12 The FROM Clause

Function

The FROM clause identifies the source of data for display.

General Format

Syntax Rules

  1. The FROM clause, when used with the TO clause, is equivalent to the USING clause, both specifying the same identifier. It must not be used with the USING clause.

  2. The identifier in the FROM clause can be qualified. If no OCCURS clause applies to the screen item, this identifier can be subscripted or indexed. It must be defined in the File, Working-Storage,

    Local-Storage,

    or Linkage Section of the program.

General Rules

  1. Executing a DISPLAY statement on a screen item whose description includes a FROM clause moves data from the associated data item to the screen item, and then displays the screen item on the screen.

9.1.1.13 The FULL Clause

Function

The FULL clause specifies that the operator must either leave the screen item completely empty or fill it entirely with data.

General Format

Syntax Rules

  1. The FULL clause is valid only in input and update fields and group items.

  2. If this clause is specified at group level, it applies to all suitable subordinate elementary items.

  3. FULL and LENGTH-CHECK are equivalent.

General Rules

  1. The FULL clause is effective during the execution of any ACCEPT statement that causes the screen item to be accepted provided the cursor enters the screen item at some time during the ACCEPT operation. Until this clause is satisfied, terminator keystrokes are rejected. If the item is fixed format numeric edited, the cursor is repositioned to the decimal point position.

  2. If the screen item is alphanumeric, in order to satisfy this clause either the entire item must contain only spaces or prompt characters, or both the first and last character positions must contain non-space, non-prompt characters.

  3. If the screen item is free format numeric or free format numeric edited, then to satisfy the clause, either the resultant value must be zero, or both the first and last character positions must contain non-space, non-prompt characters.

  4. If the screen item is fixed format numeric edited, then to satisfy the clause either the value must be zero or there must be no digit positions in which zero-suppression has taken effect.

  5. The FULL clause has no effect on fixed format numeric or on numeric edited screen items that have no zero-suppression positions.

  6. For update fields, the FULL clause can be satisfied by initial data as well as operator-keyed data.

  7. The FULL clause cannot be effective if a function key is used to terminate the ACCEPT operation. (See your COBOL system documentation about user interfaces for details of configuration options.)

  8. An error message can be configured for display on the screen if the FULL clause is not satisfied. (See your COBOL system documentation about user interfaces for details of configuration options.)

9.1.1.14 The GRID Clause

Function

The GRID clause causes each character of the screen item to have a vertical line on its left-hand side when the item appears on the screen. Each line is within the character-position.

General Format

Syntax Rules

  1. The GRID clause can be used with any screen item.

  2. If the GRID clause is specified at group level, it applies to all suitable subordinate elementary items.

  3. If this clause is used on a system that does not support characters with vertical left-hand lines it has no effect.

General Rules

  1. The GRID clause causes each character of the screen item to have a vertical line on its left-hand side when the item appears on the screen. Each line is within the character-position.

9.1.1.15 The HIGHLIGHT Clause

Function

The HIGHLIGHT clause causes the screen item to appear in high intensity mode when it appears on the screen.

General Format

Syntax Rules

  1. This clause is valid for input, output, update or literal fields.

  2. If the HIGHLIGHT clause is specified at group level, it applies to all suitable subordinate elementary items.

General Rules

  1. If the FOREGROUND-COLOR clause is also specified, the HIGHLIGHT clause causes the foreground colors to become brighter and lighter; for example on some hardware, black can become grey and brown can become yellow. However, this does not apply to the BLANK SCREEN clauses.

9.1.1.16 The JUSTIFIED Clause in the Screen Section

Function

The JUSTIFIED clause specifies non-standard positioning of data within a screen item when data is either moved to it or entered into it.

General Format

Syntax Rules

  1. JUST is an abbreviation for JUSTIFIED.

  2. The JUSTIFIED clause is allowed only with input, output and update fields.

General Rules

  1. If the screen item is an output or update field, when data is moved to it from the sending item, the JUSTIFIED clause is applied according to the normal rules for MOVE.

  2. If the screen item is an input or update field, when the accepting of data into it has terminated, the JUSTIFIED clause causes the data entered to be moved right by the number of character positions occupied by prompt characters, and the left of the field to be padded with spaces. This is done before the data is moved to the receiving item. This does not occur if data is not entered.

  3. If the screen item has a SECURE clause, the effect on the data is the same as it would be without the SECURE clause, but this effect does not appear on the screen.

9.1.1.17 The LEFTLINE Clause

Function

The LEFTLINE clause causes the leftmost character of the screen item to have a vertical line on its left-hand side when the item appears on the screen. The line is within the character- position.

General Format

Syntax Rules

  1. The LEFTLINE clause can be used with any screen item.

  2. If the LEFTLINE clause is specified at group level, it applies to all suitable subordinate elementary items.

  3. If this clause is used on a system that does not support characters with vertical left-hand lines it has no effect.

General Rules

  1. The LEFTLINE clause causes the leftmost character of the screen item to have a vertical line on its left-hand side when the item appears on the screen. The line is within the character-position.

9.1.1.18 The LINE Clause

Function

The LINE clause specifies the line at which the screen item starts on the screen.

General Format

Syntax Rules

  1. Identifier-1 must be an unsigned numeric integer and must contain a value greater than zero and less than 256.

  2. Integer-1 must be unsigned, greater than zero and less than 256.

  3. PLUS and "+" are equivalent.

  4. Omitting the NUMBER phrase results in a default value of PLUS 1.

  5. The current line is assumed for screen descriptions which omit the LINE clause.

  6. The LINE clause can be specified with any elementary item.

  7. When the LINE clause is specified anywhere within the hierarchy of a SCREEN SECTION group item, then at least one of the following clauses must also be specified within the same group definition:

    BEEP, BELL, BLANK LINE, BLANK SCREEN, ERASE EOL, ERASE EOS, FROM, TO, USING, or VALUE.

General Rules

  1. The LINE clause specifies the line on which the screen item is to appear on the screen in an ACCEPT or DISPLAY operation.

  2. If the LINE clause has identifier-1 or integer-1 but does not specify PLUS,

    "+" or "–",

    the clause gives an absolute line number within the screen record. Each 01 level represents a screen record. The AT phrase of the ACCEPT and DISPLAY statements specifies the positioning of the start of the screen record relative to the start of the display screen. If the AT phrase is not specified, then line 1 is the first line on the screen.

  3. If PLUS,

    "+" or "–",

    is specified in the LINE clause, then the line number is relative to that at which the preceding screen item ends, regardless of whether or not the statement displays the preceding item on the screen. This depends on the current effective length of that item at run time, derived from its PICTURE, VALUE and SIZE clauses. The counting of line numbers restarts at a level 01 item at line 1.

  4. If a Screen Description contains neither a LINE or COLUMN clause, and the item is not a level 01 item, COLUMN PLUS 1 is assumed. The item then starts immediately following the preceding item in the screen section.

  5. If a LINE position that is specified is off the screen, the ACCEPT or DISPLAY is truncated.

  6. If PLUS

    "+" or "–",

    is specified in the LINE clause, and an ACCEPT or DISPLAY statement referencing the Screen Section item includes the AT LINE NUMBER phrase, the line number at which this item is presented is the sum or difference of the two numbers.

9.1.1.19 The LOWLIGHT Clause

Function

The LOWLIGHT clause specifies that the field is to appear on the screen with the lowest intensity.

General Format

Syntax Rules

  1. If the LOWLIGHT clause is specified at group level, it applies to all suitable subordinate elementary items.

General Rules

  1. The LOWLIGHT clause specifies that the field is to appear on the screen with the lowest intensity.

9.1.1.20 The OCCURS Clause in the Screen Section

Function

The OCCURS clause eliminates the need for separate entries for repeated screen items and supplies information required for the application of subscripts or indices.

General Format

Syntax Rules

  1. The OCCURS clause is not allowed at 01 level.

  2. If USING or TO clauses apply to the item, or to any item subsidiary to the item, then the same number of OCCURS clauses, specifying the same number of occurrences, must apply to the receiving item. These OCCURS clauses must not include the DEPENDING phrase.

  3. If a FROM clause applies to the item, or to any item subsidiary to the item, either the same number of OCCURS clauses, specifying the same number of occurrences, or no OCCURS clauses at all, must apply to the sending item. These OCCURS clauses must not include the DEPENDING phrase.

General Rules

  1. In a screen description which is subject to an OCCURS clause, the LINE and COLUMN clauses apply to each individual table entry. Thus either the LINE or the COLUMN clause should specify relative positioning, because if they both specify an absolute position every entry will appear in the same place.

  2. If the screen item is an output field, and no OCCURS clauses apply to the sending item, in a DISPLAY operation the contents of the sending item are moved to every occurrence of the screen item. An elementary item that is fully subscripted is deemed to have no OCCURS clauses applying to it.

  3. If the screen item is an update field, or it is an output field with OCCURS clauses applying to the sending item, then in a DISPLAY operation the contents of each occurrence of the sending item are moved to the corresponding occurrence of the screen item.

  4. If the screen item is an update or input field, then in an ACCEPT operation the data entered into each occurrence of the screen item is moved to the corresponding occurrence of the receiving item.

9.1.1.21 The OVERLINE Clause

Function

The OVERLINE clause causes every character of the screen item to have a horizontal line above it when the item appears on the screen. The line is within the character-position.

General Format

Syntax Rules

  1. The OVERLINE clause can be used with a screen item.

  2. If the OVERLINE clause is specified at group level, it applies to all suitable subordinate elementary items.

  3. If this clause is used on a system that does not support overlining it has no effect.

General Rules

  1. The OVERLINE clause causes every character of the screen item to have a horizontal line above it when the item appears on the screen.

9.1.1.22 The PICTURE Clause in the Screen Section

Function

The PICTURE clause describes the length, general characteristics and editing requirements of a screen item.

General Format

Syntax Rules

  1. The PICTURE clause can include any standard editing characters.

  2. The PICTURE clause must be used in conjunction with one or more of the FROM, TO or USING clauses. The USING clause must not be used with either the FROM or TO clause.

  3. PIC is an abbreviation for PICTURE.

  4. The PICTURE clause is allowed only with elementary items.

  5. The PICTURE clause need not be the same as the PICTURE clause of the data item referenced in the FROM, TO or USING clause but it must be such that the implied MOVE is legal.

General Rules

  1. The character-string describes the length and category of the screen item. It is used in the same way as the character-string in the PICTURE clause for a data item.

  2. We recommend that every numeric screen item either be a numeric edited item or contain only 9's in its PICTURE clause. Editing and de-editing are applied as necessary when data is moved to or from the associated data item.

9.1.1.23 The PROMPT Clause

Function

The PROMPT clause causes the empty character positions in the screen item to be marked on the screen during an ACCEPT operation while the system is ready to accept operator-keyed data into that item.

General Format

Syntax Rules

  1. This clause is allowed only with input and update fields and with group items.

  2. If this clause is specified at group level, it applies to all subordinate elementary items.

  3. Identifier-1 must be a single-character alphabetic or alphanumeric data item.

  4. Identifier-1 must not be subject to an OCCURS clause.

  5. Literal-1 must be a one-character nonnumeric literal or a figurative constant.

General Rules

  1. For items in the Screen Section :

    1. PROMPT is always on.

    2. If the PROMPT clause is not specified, or is specified without the CHARACTER phrase, the default prompt character is used.

  2. For other data items referenced in an ACCEPT statement,

    1. PROMPT is on if and only if the PROMPT clause is specified on the ACCEPT statement.

    2. If the PROMPT clause is specified without the CHARACTER phrase, the default prompt character is used.

  3. The CHARACTER phrase specifies a prompt character to be used for marking empty character positions. The prompt character overrides the configured option. (See your COBOL system documentation about user interfaces for details on configuration options.)

  4. The PROMPT clause causes the prompt character to replace trailing spaces in alphanumeric or free format numeric screen items. It also causes the prompt character to replace leading suppressed digit positions in fixed format numeric edited screen items.

  5. The PROMPT clause has no effect on fixed format, nonedited numeric screen items or numeric edited screen items that have no zero-suppression positions.

  6. If PROMPT is on for a field, you cannot move the cursor past the end of the field, which is marked by prompt characters. An attempt to do so will move the cursor to the next field .

  7. If PROMPT is not on for a field, the cursor can be moved to the spaces following the end of the field.

  8. This clause has no effect if the SECURE clause is specified.

  9. The prompt characters appearing in the screen item are changed to spaces upon termination of the ACCEPT operation.

9.1.1.24 The REQUIRED Clause

Function

The REQUIRED clause specifies that the operator must not leave the screen item empty.

General Format

Syntax Rules

  1. The REQUIRED clause is allowed only with input and update fields and with group items.

  2. This clause can be specified on a group screen item, in which case it applies to all suitable elementary items which are subordinate to that item.

  3. REQUIRED and EMPTY-CHECK are equivalent.

General Rules

  1. The REQUIRED clause takes effect during the execution of any ACCEPT statement that causes the screen item to be accepted provided the cursor enters the screen item at some time during the ACCEPT. Unless this clause is satisfied, terminator keystrokes are rejected and the cursor is repositioned to the beginning of the item.

  2. To satisfy this clause, alphanumeric screen items must contain at least one non-space, non-prompt character; numeric screen items must have a non-zero value.

  3. For update fields, the REQUIRED clause can be satisfied by initial data as well as by operator-keyed data.

  4. The REQUIRED clause cannot be effective if a function key is used to terminate an ACCEPT operation. (See your COBOL system documentation about user interfaces for details on configuration options.)

  5. An error message can be configured for display on the screen if the REQUIRED clause is not satisfied. (See your COBOL system documentation about user interfaces for details on configuration options.)

9.1.1.25 The REVERSE-VIDEO Clause

Function

The REVERSE-VIDEO clause causes the screen item to be displayed in reverse-video.

General Format

Syntax Rules

  1. The REVERSE-VIDEO clause is allowed with any screen item.

  2. If the REVERSE-VIDEO clause is specified at group level, it applies to all suitable subordinate elementary items.

General Rules

  1. The REVERSE-VIDEO clause causes the screen item to be displayed in reverse-video.

9.1.1.26 The SECURE Clause

Function

The SECURE clause prevents operator-keyed data from appearing on the screen.

General Format

Syntax Rules

  1. The SECURE clause is allowed only with input and update fields.

  2. This clause can be specified on a group screen item, in which case it applies to all suitable elementary items which are subordinate to that item.

    SECURE and NO-ECHO are equivalent.

General Rules

  1. When the SECURE clause is specified for input fields, only spaces and the cursor appear in the screen item. For update fields, the original contents of the field will be displayed, but cannot be altered.

9.1.1.27 The SIGN Clause in the Screen Section

Function

The SIGN clause specifies the position and representation of the operational sign.

General Format

Syntax Rules

  1. The SIGN clause is allowed only with input, output and update fields whose pictures contain the character "S".

  2. This clause is allowed only with elementary items.

General Rules

  1. It is recommended that the SEPARATE option be used when the SIGN clause is specified in a screen description. If the SEPARATE option is not specified, a sign denoted by "S" in a PICTURE clause appears as an overpunch.

9.1.1.28 The SIZE Clause

Function

The SIZE clause specifies the current size of the screen item.

General Format

Syntax Rules

  1. The SIZE clause is allowed only with elementary screen items.

  2. Identifier-1 must be an unsigned numeric integer and must not be subject to an OCCURS clause.

  3. Integer-1 must be unsigned.

General Rules

  1. The SIZE clause has no effect if the size specified is zero.

  2. If the SIZE clause is specified for a numeric or numeric edited screen item and the size specified is not zero, the screen item is treated as though it were free format. This overrides the setting of the configuration option.

  3. If the size specified in the SIZE clause is less than that implied by the associated PICTURE or VALUE clause, only the left-hand portion of the screen item appears on the screen. If the JUSTIFIED clause is present in an ACCEPT statement, only the right-hand portion of the screen item appears. The remainder of the screen item can be considered to contain spaces or zeros, as appropriate.

  4. If the size specified in the SIZE clause is greater than that implied by the PICTURE or VALUE clause for output or literal fields, the screen item is padded on the right with spaces.

  5. Changing the value in identifier-1 alters the effective size of the screen item at run-time. This can alter the screen positions of items whose descriptions follow it in the Screen Section. (See the sections The LINE Clause and The COLUMN Clause earlier in this chapter.)

9.1.1.29 The TO Clause

Function

The TO clause identifies the destination of data accepted.

General Format

Syntax Rules

  1. The TO clause, when used with the FROM clause, is equivalent to the USING clause, both specifying the same identifier. It must not be used with the USING clause.

  2. The identifier in the TO clause can be qualified. If no OCCURS clause applies to the screen item, this identifier can be subscripted or indexed. It must be defined in the File, Working-Storage,

    Local-Storage,

    or Linkage Section of the program.

General Rules

  1. Executing an ACCEPT statement on a screen item whose description includes a TO clause accepts operator-keyed data into the screen item, and then moves that data to the associated data item.

9.1.1.30 The UNDERLINE Clause

Function

The UNDERLINE clause causes the screen item to be underlined when
it appears on the screen.

General Format

Syntax Rules

  1. The UNDERLINE clause is allowed with any screen item.

  2. If the UNDERLINE clause is specified at group level, it applies to all suitable subordinate elementary items.

General Rules

  1. The UNDERLINE clause causes the screen item to be underlined when it appears on the screen.

  2. This clause has no effect if your screen hardware does not support underline.

9.1.1.31 The USAGE Clause in the Screen Section

Function

The USAGE clause specifies the format of a data item in the computer storage.

General Format

Syntax Rules

  1. The USAGE of a Screen Section data item must be either explicitly or implicitly defined as USAGE DISPLAY or USAGE DISPLAY-1.

9.1.1.32 The USING Clause

Function

The USING clause identifies the source of data for display.

General Format

Syntax Rules

  1. The USING clause is equivalent to the TO and FROM clauses, both specifying the same identifier. It must not be used with either the TO or FROM clause.

  2. The identifier in the USING clause can be qualified. If no OCCURS clause applies to the screen item, this identifier can be subscripted or indexed. It must be defined in the File, Working-Storage, Local-Storage, or Linkage Section of the program.

General Rules

  1. Executing a DISPLAY statement on a screen item whose description includes a USING clause moves data from the associated data item to the screen item, and then displays the screen item on the screen.

  2. Executing an ACCEPT statement on a screen item whose description includes a USING clause accepts operator-keyed data into the screen item, and then moves that data to the associated data item.

9.1.1.33 The VALUE Clause in the Screen Section

Function

The VALUE clause specifies literal information for display on the screen.

General Format

Syntax Rules

  1. The literal associated with the VALUE clause must be nonnumeric. It cannot be a figurative constant.

  2. The VALUE clause is allowed only with elementary items that have no PICTURE clauses.

General Rules

  1. The VALUE clause specifies literal information for display on the screen.

9.1.1.34 The ZERO-FILL Clause

Function

The ZERO-FILL clause causes trailing prompt characters to be replaced by zeros instead of spaces.

General Format

Syntax Rules

  1. This clause is allowed only with input and update fields that are alphabetic or alphanumeric.

General Rules

  1. The ZERO-FILL clause causes trailing prompt characters to be replaced by zeros instead of spaces when data is moved from the screen item to the receiving item. This occurs only if the operator enters data into the screen item.

  2. If the receiving item has a JUSTIFIED clause, the ZERO-FILL clause causes leading positions left vacant by justification to be zero-filled.


Copyright © 1998 Micro Focus Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
PreviousData Division - Data Description Procedure DivisionNext