Skip to content

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:

  1. The USING data-1 clause implies a MOVE from the target data-1 to the subject of the USING clause when a DISPLAY [Screen] statement is executed, and a MOVE TO the target data-1 when an ACCEPT [Screen] statement is executed.
  2. The target data-1 must have the same PICTURE clause as the subject item declared in the Screen Section.
  3. 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:

  1. The FROM identifier-1 clause implies a MOVE from the target identifier-1 to the subject of the TO clause when a DISPLAY [Screen] statement is executed.
  2. The target identifier-1 must have the same PICTURE clause as the subject of the FROM clause.
  3. 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:

  1. The TO data-1 clause implies a MOVE from the subject of the TO clause to the data-1 item that is the target of the TO clause when an ACCEPT [Screen] statement is executed.
  2. The target data-1 must have the same PICTURE clause as the subject of the TO clause.
  3. 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:

  1. numeric-1 is a literal or data item that is numeric.
  2. The OCCURS clause may not be used at the 01-level of the Screen description.
  3. The OCCURS clause may be used to create a two dimensional table, as shown in the example below.
  4. 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 Section OCCURS.

General Rules:

  1. For a summary of the General Rules that apply to the OCCURS clause, see the OCCURS Clause section
  2. Data items declared under an OCCURS clause must not contain subscripts.
  3. The effect of the DISPLAY of a table within a SCREEN SECTION OCCURS, is to cause the items in the table to be transferred to the screen, assuming their relative positions within the table.
  4. The effect of the ACCEPT of a table within a SCREEN 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:

  1. AUTO, AUTO SKIP, and AUTO TERMINATE are synonyms.
  2. If the AUTO attribute is described on a group level, it applies to all of the screen items subordinate to that group.
  3. The AUTO attribute moves the cursor automatically to the next input field when the current input field is full.
  4. 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 the AUTO attribute is to cause the ACCEPT 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:

  1. BACKGROUND-COLOR and BACKGROUND-COLOUR are synonyms.
  2. If the BACKGROUND-COLOR attribute is described on a group level, it applies to all of the screen items subordinate to that group.
  3. 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:

  1. BELL and BEEP are synonyms.
  2. Some operating systems do not support the BELL clause. On operating systems that do not support the BELL clause, the BELL clause is treated as commentary.
  3. The BELL clause causes the screen field described with the BELL clause to be “beep” when the Screen item is referenced.
  4. The NO BELL/NO BEEP phrase suppresses the warning “beep” when the input field is entered.

BLANK

General Format:

       [ BLANK {LINE  } ] 
               {SCREEN}

General Rules:

  1. The BLANK LINE clause causes the entire line on which the screen item is described to be cleared before executing the DISPLAY of that line.
  2. The BLANK SCREEN clause causes the entire screen to be cleared before executing the DISPLAY of the screen.
  3. The BLANK LINE and BLANK SCREEN clauses are ignored during an ACCEPT statement.

General Format:

[ BLINK ]

General Rules:

  1. Some operating systems do not support the BLINK clause. On operating systems that do not support the BLINK clause, the BLINK clause is treated as commentary.
  2. The BLINK clause causes the screen field described with the BLINK clause to blink when the Screen item is referenced.

COLUMN

General Format:

       [ {COLUMN} numeric-1 [ [ IS ] [ {PLUS } ] numeric-2 ] ] 
         {COL   }                      {  +  } 
                                       {MINUS} 
                                       {  -  }

Syntax:

  1. numeric-1 is a numeric literal or data item.
  2. numeric-2 is a numeric literal or data item.

General Rules:

  1. The COLUMN clause establishes the horizontal position at which to start a DISPLAY or ACCEPT statement, while the LINE clause establishes the vertical position for the given Screen display .
  2. The PLUS numeric-2 and MINUS 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 of integer-2. MINUS numeric-2 causes the relative column position to decrease by the value of integer-2.

ERASE

General Format:

       ERASE {EOL} ] 
             {EOS}

General Rules:

  1. EOL and END OF LINE are synonyms.
  2. EOS and END OF SCREEN are synonyms.
  3. The ERASE clause causes a portion of the screen to be erased before the DISPLAY statement transfers data to the screen. The portion of the screen to be erased begins at the position of the screen item declaring the ERASE clause, and proceeds as follows:
  4. ERASE EOL erases the screen from the position of the current field to the end of the current line.
  5. 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:

  1. FOREGROUND-COLOR and FOREGROUND-COLOUR are synonyms.
  2. If the FOREGROUND-COLOR attribute is described on a group level, it applies to all of the screen items subordinate to that group.
  3. 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:

  1. HIGHLIGHT and HIGH are synonyms.
  2. Some operating systems do not support the HIGHLIGHT clause. On operating systems that do not support the HIGHLIGHT clause, the HIGHLIGHT clause is treated as commentary.
  3. The HIGHLIGHT clause causes the screen field described with the HIGHLIGHT 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:

  1. The LINE clause establishes the vertical position at which to start a DISPLAY or ACCEPT statement, while the COLUMN clause establishes the horizontal position on the given LINE position.
  2. 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.
  3. The PLUS numeric-2 and MINUS 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:

  1. LOWLIGHT and LOW are synonyms.
  2. Some operating systems do not support the LOWLIGHT clause. On operating systems that do not support the LOWLIGHT clause, the LOWLIGHT clause is treated as commentary.
  3. The LOWLIGHT clause causes the screen field described with the LOWLIGHT clause to be displayed with low intensity when the Screen item is referenced.

OVERLINE

General Format:

[ OVERLINE ]

General Rules:

  1. Some operating systems do not support the OVERLINE clause. On operating systems that do not support the OVERLINE clause, the OVERLINE clause is treated as commentary.
  2. The OVERLINE clause causes characters in a field described with the OVERLINE clause to be OVERLINE’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:

  1. The PROMPT CHARACTER is displayed for all input fields when a SCREEN is DISPLAY’ed.
  2. The default PROMPT CHARACTER is the und erscore.
  3. The PROMPT CHARACTER clause provides the ability to substitute another character for the underscore as the default PROMPT character in an input field.
  4. 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.
  5. The PROMPT CHARACTER is a display attribute, and is not transferred back to the TO/USING field associated with the input field after the ACCEPT has terminated.

REQUIRED

General Format:

       [ {REQUIRED   } ] 
         {EMPTY-CHECK}

General Rules:

  1. 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 the ACCEPT.
  2. REQUIRED and EMPTY-CHECK are synonyms.

REVERSE-VIDEO

General Format:

[ REVERSE-VIDEO ]

General Rules:

  1. Some operating systems do not support the REVERSE-VIDEO clause. On operating systems that do not support the REVERSE-VIDEO clause, the REVERSE-VIDEO clause is treated as commentary.
  2. The REVERSE-VIDEO clause causes the foreground and background colors described, or implicit for the characters in a field described with the REVERSE-VIDEO clause to be reversed when the Screen item is referenced.

SECURE

General Format:

       [ {SECURE } ] 
         {NO-ECHO}

General Rules:

  1. The SECURE attribute inhibits the display of data that is entered into a data entry fields.
  2. When an ACCEPT is performed on a field with the SECURE attribute, the field is DISPLAY’ed as a string of asterisks. The process of data entry moves the cursor, but does not otherwise alter the DISPLAY’ed view of the field.
  3. 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:

  1. The SIZE attribute describes the number of bytes that are returned to the screen.
  2. If SIZE is less than the length of the data item, the n the space is padded with SPACES.

UNDERLINE

General Format:

[ UNDERLINE ]

General Rules:

  1. Some operating systems do not support the UNDERLINE clause. On operating systems that do not support the UNDERLINE clause, the UNDERLINE clause is treated as commentary.
  2. The UNDERLINE clause causes characters in a field described with the UNDERLINE clause to be UNDERLINE’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.

Back to top