Screen Description Entry COBOL

Format 1:Screen Group

Screen Group

Format 2:Screen Literal

Screen Literal

Format 3:Screen Field

Screen Field

Screen Field

level-number-1 must be in the range 01 to 49, or 77.Level-numbers 66 and 88 are not allowed.Level-numbers in the range 01 through 49 are used to define group and elementary fields in the same way as in the other sections of the Data Division.

A screen description entry that contains a screen-name following the level-number defines that screen-name.Screen-names may be used only in ACCEPT and DISPLAY statements.A screen-name is not a data-name, and the two types of names are not interchangeable.

A particular screen-attribute may not be specified more than once in a given screen description entry.The possible screen-attributes are defined in the following subsections.Note that a number of the clauses that can be used in other sections of the Data Division are not available in the Screen Section.These include OCCURS, REDEFINES, RENAMES, SIGN, SYNC and USAGE.

AUTO Clause

AUTO

The AUTO clause may be used either at the group level or at the elementary level.When used at the group level the effect is as if it were specified in each subordinate elementary entry that specifies a PICTURE clause with a TO or USING option.

When an elementary field that has the AUTO attribute is functioning as an input field during the course of an ACCEPT operation, the field is considered to be complete as soon as sufficient characters have been entered to fill the field.If the field is not the last input field in the group to which it belongs, the cursor moves to the next field and the ACCEPT operation continues.If the field is the last input field in the group to which it belongs, the ACCEPT operation terminates.

In the absence of the AUTO attribute, the operator must explicitly terminate each field before the cursor moves to the next input field.

BACKGROUND Clause

BACKGROUND Clause

color-name-1 may be any properly formed user-defined word that names a color known to the runtime system.The default names known to all RM/COBOL runtime systems are provided in Table. color-name-1 is not a data-name, that is, color-name-1 must be the color-name itself and does not refer to a data item that contains the color-name.

The BACKGROUND clause may be used either at the group level or at the elementary level.When used at the group level the effect is as if it were specified in each subordinate elementary entry that is not controlled by an intervening nested BACKGROUND clause.

The BACKGROUND clause causes the background of the screen field to be shown in the specified color provided the terminal supports color operations and provided the appropriate configuration operations have been performed.The specification is effective for both input and output fields.

The BACKGROUND-COLOR clause is an alternative method of specifying the background color for the screen item.It is provided for compatibility with other common dialects of COBOL.The value of integer-1 must be in the range 0 through 7 and specifies a color-name according to Table.

Color Integers

Color Integers

The BACKGROUND-COLOR clause may be used either at the group level or at the elementary level with the same result as a BACKGROUND clause that specifies a color-name corresponding to the value of integer-1.

BELL Clause

BELL Clause

During the course of a DISPLAY operation, the terminal’s audible alert signal is sounded when the cursor encounters an elementary input field that has the BELL attribute.

The BELL clause may be used only at the elementary level.

The words BELL and BEEP are synonymous.

BLANK LINE Clause

BLANKLINE

During the course of a DISPLAY operation, when the cursor encounters an elementary field that has the BLANK LINE attribute, the line from the position of the cursor to the right end of the line is cleared to spaces.The position of the cursor remains unchanged.

The BLANK LINE clause may be used only at the elementary level.

BLANK REMAINDER Clause

BLANKREMAINDER

During the course of a DISPLAY operation, when the cursor encounters an elementary field that has the BLANK REMAINDER attribute, the line from the position of the cursor to the right end of the line and all lines below the cursor are cleared to spaces. The position of the cursor remains unchanged.

The BLANK REMAINDER clause may be used only at the elementary level.

BLANK SCREEN Clause

BLANKSCREEN

During the course of a DISPLAY operation, when the cursor encounters an elementary field that has the BLANK SCREEN attribute, the entire screen is cleared to spaces.The position of the cursor remains unchanged.

The BLANK SCREEN clause may be used only at the elementary level.

Regardless of the order in which they appear in the screen description entry, the following screen attributes are always acted on in the following order:

  1. BLANK SCREEN or ERASE SCREEN
  2. LINE or COLUMN positioning
  3. BLANK REMAINDER or ERASE EOS
  4. BLANK LINE or ERASE EOL

Therefore, it is redundant to specify BLANK LINE in the same entry with BLANK REMAINDER, and it is redundant to specify either of those attributes in the same entry with BLANK SCREEN.

BLANK WHEN ZERO Clause

BLANK WHEN ZERO

The BLANK WHEN ZERO clause has the same effect in the Screen Section as it does in the other sections of the Data Division.It causes the screen field to be filled with spaces if the value of the associated item is zero.It is effective only during an output operation.

The BLANK WHEN ZERO clause can be used only at the elementary level for a screen item whose category is numeric or numeric edited.

The BLANK WHEN ZERO clause must not be specified in the same entry with a PICTURE clause having an asterisk as the zero suppression symbol.

The BLANK WHEN ZERO clause must not be specified in the same entry with a PICTURE clause that specifies an operational sign with the symbol S.

BLINK Clause

BLINK

During both ACCEPT and DISPLAY operations, the BLINK clause causes the screen field to be shown in the flashing mode if such a mode is available on the terminal.

The BLINK clause may be used only at the elementary level.

COLUMN Clause

COLUMN Clause

The COLUMN clause may be used to specify an absolute or relative horizontal position for the cursor.It may be specified only at the elementary level.The words COLUMN and COL are synonymous.

If identifier-2 is used, it must be defined in one of the other sections of the Data Division as an elementary numeric integer.It may be qualified or subscripted, but reference modification is not permitted.

If identifier-2 is used or if integer-4 is used without the PLUS option, the current value of the data item referred to by identifier-2 or the value of integer-4 is interpreted as an absolute 1-relative column position. That is, a value of 1 specifies the leftmost column position in the current line.Behavior of the cursor is undefined if the value is less than 1 or greater than the width of the screen.

If the PLUS option is used, the value of integer-4 is interpreted as an increment to the current position of the cursor, and the cursor is advanced to the right the specified number of positions. Behavior of the cursor is undefined if such advancement moves the cursor beyond the right edge of the screen.

If the COLUMN clause is omitted in an elementary screen description entry, the horizontal cursor position is:

  • if the LINE clause is used in the same screen description entry.
  • The current cursor position if the LINE clause is also omitted.

A COLUMN clause with no operand is equivalent to a COLUMN PLUS 1 clause.

ERASE Clause

ERASE Clause

The ERASE clause may be specified only for elementary screen description entries.

During a display operation, when displaying an elementary field described with the ERASE clause that specifies the EOS option, the line from the position of the cursor to the right end of the line and all lines below the cursor are cleared to spaces.The position of the cursor remains unchanged at the beginning of the screen field.

During a display operation, when displaying an elementary field described with the ERASE clause that specifies the EOL option, the line from the position of the cursor to the right end of the line is cleared to spaces.The position of the cursor remains unchanged at the beginning of the screen field.

During a display operation, when displaying an elementary field described with the ERASE clause that explicitly or implicitly specifies the SCREEN option, the line from the position of the cursor to the right end of the line is cleared to spaces.The position of the cursor remains unchanged at the beginning of the screen field.

FOREGROUND Clause

FOREGROUND Clause

color-name-2 may be any properly formed user-defined word that names a color known to the runtime system.The default names known to all RM/COBOL runtime systems are provided in Table.

color-name-2 is not a data-name, that is, color-name-2 must be the color-name itself and does not refer to a data item that contains the color-name.

The FOREGROUND clause may be used either at the group level or at the elementary level.When used at the group level the effect is as if it were specified in each subordinate elementary entry that is not controlled by an intervening nested FOREGROUND clause.

The FOREGROUND clause causes the foreground of the screen field to be shown in the specified color provided the terminal supports color operations and provided the appropriate configuration operations have been performed.The specification is effective for both input and output fields.

The FOREGROUND-COLOR clause is an alternative method of specifying the foreground color for the screen item.It is provided for compatibility with other common dialects of COBOL.The value of integer-2 must be in the range 0 through 7 and specifies a color-name according to Table.

The FOREGROUND-COLOR clause may be used either at the group level or at the elementary level with the same result as a FOREGROUND clause that specifies a color-name corresponding to the value of integer-2.

FULL Clause

FULL

The FULL clause may be used either at the group level or at the elementary level.When used at the group level the effect is as if it were specified in each subordinate elementary entry that specifies a PICTURE clause with a TO or USING option.

When an elementary field that has the FULL attribute is functioning as an input field during the course of an ACCEPT operation, the user is required to enter either a field terminator by itself, in which case the field is bypassed and the value of the associated item remains unchanged, or a sufficient number of characters to fill the entire screen field.Partially filling the screen field is not allowed.If the REQUIRED attribute is also specified, the option of entering a field terminator by itself is not available.

HIGHLIGHT and LOWLIGHT Clauses

HIGHLIGHT and LOWLIGHT Clauses

An elementary field that is described with the HIGHLIGHT clause is shown at high intensity during both ACCEPT and DISPLAY operations.

An elementary field that is described with the LOWLIGHT clause or NO HIGHLIGHT clause is shown at low intensity during both ACCEPT and DISPLAY operations.

The default intensity is high for ACCEPT operations and low for DISPLAY operations.

The HIGHLIGHT, LOWLIGHT and NO HIGHLIGHT clauses may be specified only in elementary screen description entries.

JUSTIFIED Clause

JUSTIFIED Clause

The JUSTIFIED clause has the same effect in the Screen Section as it does in the other sections of the Data Division.That is, it specifies nonstandard positioning of nonnumeric data within the screen field when the screen field is acting as a receiving field.If the associated item is longer than the screen field, the leftmost characters of the associated item are truncated and the remaining characters from the associated item are moved into the screen field.If the associated item is shorter than the screen field, the remaining leftmost positions are space-filled.In either case, the rightmost character from the associated item falls in the rightmost position of the screen field.

The JUSTIFIED clause may be used only at the elementary level and only with screen fields whose category is alphanumeric or alphabetic.It is effective only during ACCEPT operations.

JUSTIFIED and JUST are synonymous.

LINE Clause

LINE Clause

The LINE clause may be used to specify an absolute or relative vertical position for the cursor.It may be specified only at the elementary level.

If identifier-1 is used, it must be defined in one of the other sections of the Data Division as an elementary numeric integer.It may be qualified or subscripted, but reference modification is not permitted.

If identifier-1 is used or if integer-3 is used without the PLUS option the current value of the data item referred to by identifier-1 or the value of integer-3 is interpreted as an absolute 1-relative line position. That is, a value of 1 specifies the topmost line on the screen.Behavior of the cursor is undefined if the value is less than 1 or greater than the number of lines available on the screen.

If the PLUS option is used, the value of integer-3 is interpreted as an increment to the current position of the cursor, and the cursor is undefined if such advancement moves the cursor below the bottom edge of the screen.

If the LINE clause is omitted in an elementary screen description entry, the cursor position remains on the current line.

If the LINE clause is used without the COLUMN clause, the cursor is moved to the leftmost position of the specified line.Table shows the interaction of LINE and COLUMN clauses in a screen description entry.

A LINE clause with no operand is equivalent to a LINE PLUS 1 clause.

Interaction of LINE and COLUMN Clauses in a Screen Description Entry

Interaction of LINE and COLUMN Clauses in a Screen Description Entry

PICTURE Clause

PICTURE Clause

The PICTURE clause may be specified only at the elementary level; it may not be specified in the same screen description entry as a VALUE clause.

PICTURE and PIC are synonymous.

character-string-1 is defined in the same way and has the same interpretation as in the other sections of the Data Division.

As indicated by the format, a PICTURE clause in the Screen Section must contain either one or two associated items specified in the FROM, TO or USING phrases.Two associated items may be specified only if both a FROM and TO phrase are specified. The USING phrase is equivalent to specifying both a FROM and TO phrase, each of which specify the same identifier-9.

When identifier-7, identifier-8, or id entifier-9 are specified, they must have been defined as data items in one of the other sections of the Data Division.They may not be reference modified, but qualification and subscripting may be used.

When an identifier is specified as an associated data item, the compiler allocates a unique memory area for that screen item to serve as an intermediate storage area for the transmission of data between the screen field and the associated data item.The size of the intermediate storage area is determined by the PICTURE character-string in the same way as for the other sections of the Data Division.

The presence of a FROM or USING phrase in the description of a screen item marks that screen item as an output item that is active during DISPLAY operations.The execution of a DISPLAY statement causes an implicit MOVE from the associated data item to the screen item prior to displaying the screen field.

The presence of a TO or USING phrase in the description of a screen item marks that screen item as an input item that is active during ACCEPT operations.The execution of an ACCEPT statement causes an implicit MOVE from the screen item to the associated data item after accepting the screen field.

REQUIRED Clause

REQUIRED

The REQUIRED clause may be used either at the group level or at the elementary level. When used at the group level the effect is as if it were specified in each subordinate elementary entry that specifies a PICTURE clause with a TO or USING option.

When an elementary field that has the REQUIRED attribute is functioning as an input field during the course of an ACCEPT operation, the user is required to enter at least one character in the field.

REVERSE Clause

REQUIRED Clause

An elementary field that has the REVERSE attribute is shown in reverse video during both ACCEPT and DISPLAY operations.

The REVERSE clause may be used only at the elementary level.

The words REVERSE, REVERSED, and REVERSE-VIDEO are synonymous.

SECURE Clause

SECURE

The SECURE clause may be used either at the group level or at the elementary level. When used at the group level the effect is as if it were specified in each subordinate elementary entry that specifies a PICTURE clause with a TO or USING option.

When an elementary field that has the SECURE attribute is functioning as an input field during the course of an ACCEPT operation, the characters entered by the user are moved to the intermediate area but are not shown on the screen.Instead, asterisks are placed in the screen field for each character entered by the user.

SIGN Clause

SIGN Clause

The SIGN clause in a screen description entry has the same function and rules as in other sections of the Data Division, except that for screen items, the operational sign is always separate.The SIGN clause may be specified in either a group screen description entry or an elementary field screen description entry.When used at the group level it applies to all elementary items subordinate to that group that are not subordinate to an intervening nested SIGN clause.

UNDERLINE Clause

UNDERLINE

An elementary field that has the UNDERLINE attribute is shown in underline mode during both ACCEPT and DISPLAY operations, provided the terminal supports that mode.

The UNDERLINE clause may be used only at the elementary level.

USAGE Clause

[USAGE IS ] DISPLAY

The USAGE clause may be used in either a group screen description entry or an elementary field screen description entry.When used at the group level, it applies to all elementary items subordinate to that group.

The USAGE clause in the Screen Section can specify only DISPLAY usage. DISPLAY usage indicates that the format of the data is a standard data format.If the USAGE clause is not specified for an elementary item, or for any group to which the item belongs, the usage is implicitly DISPLAY.

VALUE Clause

[VALUE IS ] literal-1

literal-1 must be a nonnumeric literal.

The VALUE clause may be used only at the elementary level.It may not be specified in the same screen description entry as a PICTURE, BLANK WHEN ZERO, JUSTIFIED, SIGN, USAGE, SECURE, AUTO, REQUIRED or FULL clause.

Screen fields whose description includes a VALUE clause are active during DISPLAY operations.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

COBOL Topics