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-1
clause implies aMOVE
from the target data-1 to the subject of theUSING
clause when aDISPLAY [Screen]
statement is executed, and aMOVE TO
the target data-1 when anACCEPT [Screen]
statement is executed. - The target data-1 must have the same
PICTURE
clause 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-1
clause implies aMOVE
from the target identifier-1 to the subject of theTO
clause when aDISPLAY [Screen]
statement is executed. - The target identifier-1 must have the same
PICTURE
clause as the subject of theFROM
clause. - 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-1
clause implies aMOVE
from the subject of theTO
clause to the data-1 item that is the target of theTO
clause when anACCEPT [Screen]
statement is executed. - The target data-1 must have the same
PICTURE
clause as the subject of theTO
clause. - 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-1
is a literal or data item that is numeric.- The
OCCURS
clause may not be used at the 01-level of the Screen description. - The
OCCURS
clause 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
OCCURS
phrase, 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
OCCURS
clause, see the OCCURS Clause section - Data items declared under an
OCCURS
clause must not contain subscripts. - The effect of the
DISPLAY
of 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
ACCEPT
of a table within aSCREEN SECTION OCCURS
is 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 TERMINATE
are synonyms.- If the
AUTO
attribute is described on a group level, it applies to all of the screen items subordinate to that group. - The
AUTO
attribute moves the cursor automatically to the next input field when the current input field is full. - If the
AUTO
attribute is described on the last input field on the screen, and there is no next input field, then the effect of theAUTO
attribute is to cause theACCEPT
to 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-COLOR
andBACKGROUND-COLOUR
are synonyms.- If the
BACKGROUND-COLOR
attribute is described on a group level, it applies to all of the screen items subordinate to that group. BACKGROUND COLOR
is 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:
BELL
andBEEP
are synonyms.- Some operating systems do not support the
BELL
clause. On operating systems that do not support the BELL clause, theBELL
clause is treated as commentary. - The
BELL
clause causes the screen field described with theBELL
clause to be “beep
” when the Screen item is referenced. - The
NO BELL
/NO BEEP
phrase suppresses the warning “beep
” when the input field is entered.
BLANK
General Format:
[ BLANK {LINE } ]
{SCREEN}
General Rules:
- The
BLANK LINE
clause causes the entire line on which the screen item is described to be cleared before executing theDISPLAY
of that line. - The
BLANK SCREEN
clause causes the entire screen to be cleared before executing theDISPLAY
of the screen. - The
BLANK LINE
andBLANK SCREEN
clauses are ignored during anACCEPT
statement.
BLINK
General Format:
[ BLINK ]
General Rules:
- Some operating systems do not support the
BLINK
clause. On operating systems that do not support theBLINK
clause, theBLINK
clause is treated as commentary. - The
BLINK
clause causes the screen field described with theBLINK
clause to blink when the Screen item is referenced.
COLUMN
General Format:
[ {COLUMN} numeric-1 [ [ IS ] [ {PLUS } ] numeric-2 ] ]
{COL } { + }
{MINUS}
{ - }
Syntax:
numeric-1
is a numeric literal or data item.numeric-2
is a numeric literal or data item.
General Rules:
- The
COLUMN
clause establishes the horizontal position at which to start aDISPLAY
orACCEPT
statement, while theLINE
clause establishes the vertical position for the given Screen display . - The
PLUS numeric-2
andMINUS numeric-2
clauses cause position to be established relative to the position of the preceding screen item.PLUS numeric-2
causes the relative column position to increase by the value ofinteger-2
.MINUS numeric-2
causes the relative column position to decrease by the value ofinteger-2
.
ERASE
General Format:
ERASE {EOL} ]
{EOS}
General Rules:
EOL
andEND OF LINE
are synonyms.EOS
andEND OF SCREEN
are synonyms.- The
ERASE
clause causes a portion of the screen to be erased before theDISPLAY
statement transfers data to the screen. The portion of the screen to be erased begins at the position of the screen item declaring theERASE
clause, and proceeds as follows: ERASE EOL
erases the screen from the position of the current field to the end of the current line.ERASE EOS
erases 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-COLOR
andFOREGROUND-COLOUR
are synonyms.- If the
FOREGROUND-COLOR
attribute is described on a group level, it applies to all of the screen items subordinate to that group. FOREGROUND-COLOR
is 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:
HIGHLIGHT
andHIGH
are synonyms.- Some operating systems do not support the
HIGHLIGHT
clause. On operating systems that do not support theHIGHLIGHT
clause, theHIGHLIGHT
clause is treated as commentary. - The
HIGHLIGHT
clause causes the screen field described with theHIGHLIGHT
clause 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
LINE
clause establishes the vertical position at which to start aDISPLAY
orACCEPT
statement, while theCOLUMN
clause establishes the horizontal position on the givenLINE
position. - If there is no
LINE
clause, 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-2
andMINUS numeric-2
clauses cause position to be established relative to the position of the preceding screen item.PLUS numeric-2
causes the relative line position to increase by the value of integer-2.MINUS numeric-2
causes 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:
LOWLIGHT
andLOW
are synonyms.- Some operating systems do not support the
LOWLIGHT
clause. On operating systems that do not support theLOWLIGHT
clause, theLOWLIGHT
clause is treated as commentary. - The
LOWLIGHT
clause causes the screen field described with theLOWLIGHT
clause 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
OVERLINE
clause. On operating systems that do not support theOVERLINE
clause, theOVERLINE
clause is treated as commentary. - The
OVERLINE
clause causes characters in a field described with theOVERLINE
clause 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 CHARACTER
is displayed for all input fields when aSCREEN
isDISPLAY
’ed. - The default
PROMPT CHARACTER
is the und erscore. - The
PROMPT CHARACTER
clause provides the ability to substitute another character for the underscore as the defaultPROMPT
character in an input field. - The
PROMPT
phrase 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 CHARACTER
is a display attribute, and is not transferred back to theTO
/USING
field associated with the input field after theACCEPT
has terminated.
REQUIRED
General Format:
[ {REQUIRED } ]
{EMPTY-CHECK}
General Rules:
- The
REQUIRED
clause 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
. REQUIRED
andEMPTY-CHECK
are synonyms.
REVERSE-VIDEO
General Format:
[ REVERSE-VIDEO ]
General Rules:
- Some operating systems do not support the
REVERSE-VIDEO
clause. On operating systems that do not support theREVERSE-VIDEO
clause, theREVERSE-VIDEO
clause is treated as commentary. - The
REVERSE-VIDEO
clause causes the foreground and background colors described, or implicit for the characters in a field described with theREVERSE-VIDEO
clause to be reversed when the Screen item is referenced.
SECURE
General Format:
[ {SECURE } ]
{NO-ECHO}
General Rules:
- The
SECURE
attribute inhibits the display of data that is entered into a data entry fields. - When an
ACCEPT
is performed on a field with theSECURE
attribute, 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
SECURE
field 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
SIZE
attribute describes the number of bytes that are returned to the screen. - If
SIZE
is 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
UNDERLINE
clause. On operating systems that do not support theUNDERLINE
clause, theUNDERLINE
clause is treated as commentary. - The
UNDERLINE
clause causes characters in a field described with theUNDERLINE
clause 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.