Screen Section
The Screen Section contains descriptions of Screen Section console screen items.
[ SCREEN SECTION. ]
[ ss-data-level screen-item-description]…
Screen Description
A screen description describes all of the elements of a screen, and the attributes of each element.
General Format:
SCREEN SECTION.
level-number [ screen-name ]
[ LINE line-number [ [ IS ] [ {PLUS } ] numeric-identifier ] ]
{ + }
{MINUS}
{ - }
[ {COLUMN} col-number [ [ IS ] [ {PLUS } ] numeric-identifier ] ]
{COL } { + }
{MINUS}
{ - }
[{PICTURE} IS picture-string ]
{PIC }
[ FROM from-identifier ]
[ TO to-identifier ]
[ USING using-identifier ]
[ [ USAGE IS ] DISPLAY ]
[ [SIGN IS] {LEADING } SEPARATE CHARACTER ]
{TRAILING}
[ OCCURS integer TIMES ]
[ {JUSTIFIED} RIGHT ]
{JUST }
[ BLANK WHEN ZERO ]
[ SIZE IS length-in-bytes ]
[ VALUE IS value-lit ]
[ BLANK {LINE } ]
{SCREEN}
[ ERASE {EOL} ]
{EOS}
[ {FOREGROUND_COLOR } IS fg-color-val
{FOREGROUND-COLOUR}
[ {BACKGROUND_COLOR } IS bg-color-val
{BACKGROUND-COLOUR}
[ UNDERLINE ]
[ OVERLINE ]
[ {HIGHLIGHT} ]
{HIGH }
[ {LOWLIGHT} ]
{LOW }
[ BLINK ]
[ REVERSE-VIDEO ]
[ {AUTO } ]
{AUTO-SKIP }
{AUTO-TERMINATE}
[[NO] {BELL} ]
{BEEP}
[ {SECURE } ]
{NO-ECHO}
[ {REQUIRED } ]
{EMPTY-CHECK}
[ {FULL } ]
{LENGTH-CHECK}
[ PROMPT [CHARACTER IS prompt-literal ] ]
[ CONTROL in [control-var] ].
Syntax:
A screen-description consists of a series of screen description entries. Screen Description entries are described below.
General Rules:
The General Rules for the Screen Description clauses are described below.
Screen Description Entries
PICTURE Clause
General Format:
The PICTURE Clause is described in the PICTURE Clause section.
USING Clause
General Format:
[ USING data-1 ]
Syntax:
data-n is a data item.
General Rules:
- The
USING data-1clause implies aMOVEfrom the target data-1 to the subject of theUSINGclause when aDISPLAY [Screen]statement is executed, and aMOVE TOthe target data-1 when anACCEPT [Screen]statement is executed. - The target data-1 must have the same
PICTUREclause as the subject item declared in the Screen Section. - The target data-1 must be defined in the file section, working-storage section, local storage section or linkage section.
FROM Clause
General Format:
[ FROM identifier-1 ]
Syntax:
identifier-n is a data element, literal, or data returned from a function call.
General Rules:
- The
FROM identifier-1clause implies aMOVEfrom the target identifier-1 to the subject of theTOclause when aDISPLAY [Screen]statement is executed. - The target identifier-1 must have the same
PICTUREclause as the subject of theFROMclause. - The target identifier-1 must be defined in the file section, working-storage section, local storage section or linkage section.
TO Clause
General Format:
[ TO data-1 ]
Syntax:
data-1 is a data item.
General Rules:
- The
TO data-1clause implies aMOVEfrom the subject of theTOclause to the data-1 item that is the target of theTOclause when anACCEPT [Screen]statement is executed. - The target data-1 must have the same
PICTUREclause as the subject of theTOclause. - The target data-1 must be defined in the file section, working-storage section, local storage section or linkage section.
USAGE Clause
General Format:
[ [USAGE IS] DISPLAY ]
Syntax:
The USAGE IS DISPLAY clause is described in USAGE Clause section.
General Rules:
When the USAGE IS DISPLAY clause is entered on a group item, it applies to elements that are subordinate to the group.
SIGN Clause
General Format:
[ [ SIGN IS ] {LEADING } [ SEPARATE CHARACTER ] ]
{TRAILING}
General Rules:
The SIGN Clause is described in the SIGN Clause section.
SCREEN OCCURS Clause
The SCREEN OCCURS clause causes the DISPLAY, or ACCEPT of fields in a table to be repeated a number of times specified by a numer literal or data item. The SCREEN OCCURS clause can be used to format a table on a screen, using LINE and COL attributes with relative positioning.
General Format:
[ OCCURS numeric-1 TIMES ]
Syntax:
numeric-1is a literal or data item that is numeric.- The
OCCURSclause may not be used at the 01-level of the Screen description. - The
OCCURSclause may be used to create a two dimensional table, as shown in the example below. - When referring to a data item, for purposes of input, or output, the data item must be
declared with an
OCCURSphrase, and the number numeric-1 must be the same in the data table, and in the Screen SectionOCCURS.
General Rules:
- For a summary of the General Rules that apply to the
OCCURSclause, see the OCCURS Clause section - Data items declared under an
OCCURSclause must not contain subscripts. - The effect of the
DISPLAYof a table within aSCREEN SECTION OCCURS, is to cause the items in the table to be transferred to the screen, assuming their relative positions within the table. - The effect of the
ACCEPTof a table within aSCREEN SECTION OCCURSis to cause the items on the Screen to be transferred to the table, assuming their relative positions within the table.
Examples of usage of 1-dimensional and 2-dimensional tables, and of the display of a literal with a OCCURS phrase are included in the Code Sample below.
Code Sample:
IDENTIFICATION DIVISION.
PROGRAM-ID. SCR-OCCURS.
ENVIRONMENT DIVISION.
*
DATA DIVISION.
WORKING-STORAGE SECTION.
01 COLOR-TBL.
03 COLOR-ITEM OCCURS 5 TIMES PIC X(6).
*
01 VEGGIE-TBL.
03 OCCURS 5 TIMES.
05 VEGGIE-NAME PIC X(10).
05 VEGGIE-QTY PIC 9(5).
77 WS-DUMMY PIC X.
SCREEN SECTION.
01 SCREEN-1.
03 "COLORS:" PIC X(7) LINE 2 COL 2.
03 LINE 2 COL 10.
03 OCCURS 5 TIMES USING COLOR-ITEM PIC X(6), COLUMN + 2.
*
01 SCREEN-2.
03 "VEGETABLES QUANTITY" PIC X(24) LINE 5 COL 2.
03 LINE 6 COL 2.
03 OCCURS 5 TIMES.
05 USING VEGGIE-NAME PIC X(10) LINE + 1 COL 2.
05 USING VEGGIE-QTY PIC 9(5) COLUMN + 8
BLANK WHEN ZERO
PROMPT CHARACTER IS " ".
*
01 SCREEN-3.
03 LINE 14 COL 2.
03 OCCURS 10 TIMES.
05 "*" PIC X.
*
PROCEDURE DIVISION.
MAIN-LOGIC.
DISPLAY SCREEN-1.
ACCEPT SCREEN-1.
DiSPLAY SCREEN-2.
ACCEPT SCREEN-2.
DISPLAY SCREEN-3.
ACCEPT WS-DUMMY LINE 14 COL 25.
STOP RUN.
JUSTIFIED Clause
The JUSTIFIED RIGHT clause causes a MOVE of data to an ALPHABETIC or ALPHANUMERIC data item to align at the right-most character position of the data element.
General Format:
[ {JUSTIFIED} RIGHT ]
{JUST}
General Rules:
The JUSTIFIED Clause is described in the JUSTIFIED Clause section
VALUE Clause
The Screen Section VALUE clause is used to initialize data values when the program is initially loaded into memory.
General Format:
[ VALUE IS value-lit ]
Syntax:
value-lit is a numeric or alphanumeric literal or data item.
General Rules:
The VALUE Clause is described in the VALUE Clause section
SCREEN ATTRIBUTES
CONTROL Clause
The CONTROL Clause is recognized by the compiler, but is not fully implemented.
General Format:
[ CONTROL IS control-var ]
Syntax:
control-var is an alphanueric data item.
AUTO
General Format:
[ {AUTO } ]
{AUTO-SKIP }
{AUTO-TERMINATE}
General Rules:
AUTO,AUTO SKIP, andAUTO TERMINATEare synonyms.- If the
AUTOattribute is described on a group level, it applies to all of the screen items subordinate to that group. - The
AUTOattribute moves the cursor automatically to the next input field when the current input field is full. - If the
AUTOattribute is described on the last input field on the screen, and there is no next input field, then the effect of theAUTOattribute is to cause theACCEPTto terminate.
BACKGROUND-COLOR
General Format:
[ {BACKGROUND_COLOR } IS numeric-1
{BACKGROUND-COLOUR}
Syntax:
numeric-n is a literal or data item that is numeric.
General Rules:
BACKGROUND-COLORandBACKGROUND-COLOURare synonyms.- If the
BACKGROUND-COLORattribute is described on a group level, it applies to all of the screen items subordinate to that group. BACKGROUND COLORis expressed in an integer value between 0 and 7, with numbers corresponding to colors as described in the color table below:
| Integer | Color |
|---|---|
| 0 | Black |
| 1 | Blue |
| 2 | Green |
| 3 | Cyan |
| 4 | Red |
| 5 | Magenta |
| 6 | Yellow |
| 7 | White |
BELL
General Format:
[ [NO] {BELL} ]
{BEEP}
General Rules:
BELLandBEEPare synonyms.- Some operating systems do not support the
BELLclause. On operating systems that do not support the BELL clause, theBELLclause is treated as commentary. - The
BELLclause causes the screen field described with theBELLclause to be “beep” when the Screen item is referenced. - The
NO BELL/NO BEEPphrase suppresses the warning “beep” when the input field is entered.
BLANK
General Format:
[ BLANK {LINE } ]
{SCREEN}
General Rules:
- The
BLANK LINEclause causes the entire line on which the screen item is described to be cleared before executing theDISPLAYof that line. - The
BLANK SCREENclause causes the entire screen to be cleared before executing theDISPLAYof the screen. - The
BLANK LINEandBLANK SCREENclauses are ignored during anACCEPTstatement.
BLINK
General Format:
[ BLINK ]
General Rules:
- Some operating systems do not support the
BLINKclause. On operating systems that do not support theBLINKclause, theBLINKclause is treated as commentary. - The
BLINKclause causes the screen field described with theBLINKclause to blink when the Screen item is referenced.
COLUMN
General Format:
[ {COLUMN} numeric-1 [ [ IS ] [ {PLUS } ] numeric-2 ] ]
{COL } { + }
{MINUS}
{ - }
Syntax:
numeric-1is a numeric literal or data item.numeric-2is a numeric literal or data item.
General Rules:
- The
COLUMNclause establishes the horizontal position at which to start aDISPLAYorACCEPTstatement, while theLINEclause establishes the vertical position for the given Screen display . - The
PLUS numeric-2andMINUS numeric-2clauses cause position to be established relative to the position of the preceding screen item.PLUS numeric-2causes the relative column position to increase by the value ofinteger-2.MINUS numeric-2causes the relative column position to decrease by the value ofinteger-2.
ERASE
General Format:
ERASE {EOL} ]
{EOS}
General Rules:
EOLandEND OF LINEare synonyms.EOSandEND OF SCREENare synonyms.- The
ERASEclause causes a portion of the screen to be erased before theDISPLAYstatement transfers data to the screen. The portion of the screen to be erased begins at the position of the screen item declaring theERASEclause, and proceeds as follows: ERASE EOLerases the screen from the position of the current field to the end of the current line.ERASE EOSerases the screen from the position of the current field to the end of the screen.
FOREGROUND-COLOR
General Format:
[ {FOREGROUND_COLOR } IS numeric-1
{FOREGROUND-COLOUR}
Syntax:
numeric-n is a literal or data item that is numeric.
General Rules:
FOREGROUND-COLORandFOREGROUND-COLOURare synonyms.- If the
FOREGROUND-COLORattribute is described on a group level, it applies to all of the screen items subordinate to that group. FOREGROUND-COLORis expressed in an integer value between 0 and 7, with numbers corresponding to colors as described in the color table below:
| Integer | LOWLIGHT COLOR | HIGHLIGHT COLOR |
|---|---|---|
| 0 | Black | Dark Grey |
| 1 | Dark Blue | Bright Blue |
| 2 | Dark Green | Bright Green |
| 3 | Dark Cyan | Bright Cyan |
| 4 | Dark Red | Bright Red |
| 5 | Dark Magenta | Bright Magenta |
| 6 | Brown | Yellow |
| 7 | Light Grey | White |
FULL
General Format:
[ {FULL } ]
{LENGTH-CHECK}
General Rules:
The FULL clause is is recognized, and syntax is validated. However, the FULL clause is otherwise treated as commentary.
HIGHLIGHT
General Format:
[ {HIGHLIGHT} ]
{HIGH }
General Rules:
HIGHLIGHTandHIGHare synonyms.- Some operating systems do not support the
HIGHLIGHTclause. On operating systems that do not support theHIGHLIGHTclause, theHIGHLIGHTclause is treated as commentary. - The
HIGHLIGHTclause causes the screen field described with theHIGHLIGHTclause to be displayed with high intensity when the Screen item is referenced.
LINE
General Format:
[ LINE numeric-1 [ [ IS ] [ {PLUS } ] numeric-2 ] ]
{ + }
{MINUS}
{ - }
Syntax:
numeric-n is a literal or data item that is numeric.
General Rules:
- The
LINEclause establishes the vertical position at which to start aDISPLAYorACCEPTstatement, while theCOLUMNclause establishes the horizontal position on the givenLINEposition. - If there is no
LINEclause, then LINE 1 is assumed, with line 1 being the first line of the Screen described. Note that the Screen described may not be positioned at line 1 of the terminal. - The
PLUS numeric-2andMINUS numeric-2clauses cause position to be established relative to the position of the preceding screen item.PLUS numeric-2causes the relative line position to increase by the value of integer-2.MINUS numeric-2causes the relative line position to decrease by the value of integer-2.
LOWER-CASE
The LOWER-CASE attribute changes data entry in Screen Section input fields to lower-case.
General Format:
LOWER-CASE
General Rules:
There are no General Rules.
LOWLIGHT
General Format:
[ {LOWLIGHT} ]
{LOW }
General Rules:
LOWLIGHTandLOWare synonyms.- Some operating systems do not support the
LOWLIGHTclause. On operating systems that do not support theLOWLIGHTclause, theLOWLIGHTclause is treated as commentary. - The
LOWLIGHTclause causes the screen field described with theLOWLIGHTclause to be displayed with low intensity when the Screen item is referenced.
OVERLINE
General Format:
[ OVERLINE ]
General Rules:
- Some operating systems do not support the
OVERLINEclause. On operating systems that do not support theOVERLINEclause, theOVERLINEclause is treated as commentary. - The
OVERLINEclause causes characters in a field described with theOVERLINEclause to beOVERLINE’d when the Screen item is referenced.
PROMPT
General Format:
[ PROMPT [CHARACTER IS prompt-literal ] ]
Syntax:
prompt-literal is a one character alphanumeric literal, which is used as the “prompt”
character.
General Rules:
- The
PROMPT CHARACTERis displayed for all input fields when aSCREENisDISPLAY’ed. - The default
PROMPT CHARACTERis the und erscore. - The
PROMPT CHARACTERclause provides the ability to substitute another character for the underscore as the defaultPROMPTcharacter in an input field. - The
PROMPTphrase causes the input field to be filled with the specified prompt character prior to entry. If the prompt character is omitted, underscores are used. - The
PROMPT CHARACTERis a display attribute, and is not transferred back to theTO/USINGfield associated with the input field after theACCEPThas terminated.
REQUIRED
General Format:
[ {REQUIRED } ]
{EMPTY-CHECK}
General Rules:
- The
REQUIREDclause indicates that an input field must have non space character data entered before the user may proceed to the next input field, or terminate theACCEPT. REQUIREDandEMPTY-CHECKare synonyms.
REVERSE-VIDEO
General Format:
[ REVERSE-VIDEO ]
General Rules:
- Some operating systems do not support the
REVERSE-VIDEOclause. On operating systems that do not support theREVERSE-VIDEOclause, theREVERSE-VIDEOclause is treated as commentary. - The
REVERSE-VIDEOclause causes the foreground and background colors described, or implicit for the characters in a field described with theREVERSE-VIDEOclause to be reversed when the Screen item is referenced.
SECURE
General Format:
[ {SECURE } ]
{NO-ECHO}
General Rules:
- The
SECUREattribute inhibits the display of data that is entered into a data entry fields. - When an
ACCEPTis performed on a field with theSECUREattribute, the field isDISPLAY’ed as a string of asterisks. The process of data entry moves the cursor, but does not otherwise alter theDISPLAY’ed view of the field. - The data entered into a
SECUREfield is stored in ithe field into which it was entered, and may be viewed in a debugger. It is not encrypted in any way.
SIZE
General Format:
[ SIZE ] [ IS ] length-in-bytes
General Rules:
- The
SIZEattribute describes the number of bytes that are returned to the screen. - If
SIZEis less than the length of the data item, the n the space is padded withSPACES.
UNDERLINE
General Format:
[ UNDERLINE ]
General Rules:
- Some operating systems do not support the
UNDERLINEclause. On operating systems that do not support theUNDERLINEclause, theUNDERLINEclause is treated as commentary. - The
UNDERLINEclause causes characters in a field described with theUNDERLINEclause to beUNDERLINE’d when the Screen item is referenced.
UPPER-CASE
The UPPER-CASE attribute changes data entry in Screen Section input fields to upper-case.
General Format:
UPPER-CASE
General Rules:
There are no General Rules.