1 / 19

Screen Section

Screen Section. COBOL. The SCREEN SECTION is a non-ANSI feature of MS-COBOL and if used, should appear as the last section of DATA DIVISION. Format :: SCREEN SECTION . screen-description-entry. COBOL.

Download Presentation

Screen Section

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Screen Section COBOL

  2. The SCREEN SECTION is a non-ANSI feature of MS-COBOL and if used, should appear as the last section of DATA DIVISION. Format :: SCREENSECTION. screen-description-entry. COBOL

  3. The Screen description entry can be either a group item or elementary item that should be involved during ACCEPT, DISPLAY or both. • The level number in the screen description entry, is followed optionally by a screen name which is user defined name like a data name. • The purpose of the screen name is to use it in the ACCEPT or DISPLAY statement. COBOL

  4. General formats of ACCEPT and DISPLAY statements:: ACCEPT screen-name [ ONESCAPE . imperative-statement ] DISPLAY screen-name COBOL

  5. The ON ESCAPE phrase in the ACCEPT statement may be specified to gain control when a terminating key other than the Enter key, is pressed. • The entire ACCEPT is terminated, an appropriate value is set and the imperative-statement is executed. • The screen-name appearing in the ACCEPT/DISPLAY statement should be described in the SCREEN SECTION. COBOL

  6. A Screen description entry for an elementary item in the simple form is :: • Level-number [ screen-name ] [ location- specification ] field-specification. The location-specification indicates the starting position on the screen wherefrom the desired item should be accepted/displayed. COBOL

  7. [ LINE NUMBER IS [ PLUS ] integer-1 ] [ COLUMN NUMBER IS [ PLUS ] integer-2 ] The LINE clause indicates the line number on the screen and the COLUMN clause indicates the column position on the line. When a PLUS is used, it means that current line number or the current column number plus integer-1 or integer-2 respectively. When only LINE is specified and Column is omitted, then column position 1 of the given line is assumed. COBOL

  8. The field specification describes how the field should appear on the screen after DISPLAY or ACCEPT statement • The general format for field-specification is :: [[ VALUE ] IS literal-1 ] [ PICTURE IS character-string [ FROM Literal-2 ] PIC Identifier-1 [ TO identifier-2 ] ] [ USING identifier-3 ] COBOL

  9. The PICTURE clause describes screen item in the usual way through the character string. Any valid picture character (including editing character) can appear in the character string . When TO clause is used , the screen item becomes an input item and is used only during an ACCEPT. It has no effect during a DISPLAY. When the VALUE or FROM clause is used the screen item becomes an output item and is used only during a DISPLAY. It has no effect during an ACCEPT. Identifier-2 indicates the receiving field to which the accepted data should be more from the screen. Similarly literal-1, literal-2 or identifier-1 indicates the source of the data to be displayed. COBOL

  10. Example 1 05 LINE 10 COLUMN 15 PIC X(10) FROM ORDER-NO. The source field is ORDER-NO which is described elsewhere in DATA DIVISION. The value of ORDER-NO will be displayed in 10 positions staring from position from (10,15) on the screen COBOL

  11. Example 2 05 COLUMN 20 VALUE IS “What is your name ? “ This is an output item. The Value of the literal will be displayed starting from column position 20 of the current line. COBOL

  12. Example 3 10 LINE 5 COLUMN PLUS 2 PIC 9(5)V99 TO ACC-NO. This is an input field and will be involved only during an ACCEPT associated to this field. The value will be accepted from line number 5 starting from a position which is given by current column number plus 2. COBOL

  13. When the value has been entered on the screen, ACCEPT will move it to ACC-NO which is the receiving field. This receiving filed should be described elsewhere in the DATA DIVISION. COBOL

  14. Example 4 DATA DIVISION. SCREEN SECTION. 01 MY-SCREEN. 05 LINE 2 COLUMN 5 VALUE “ENTER DATE” 05 COLUMN 15 PIC X(6) USING TRANS-DATE. 05 LINE 5 COLUMN 5 VALUE “ORDER-NUMBER” 05 COLUMN 15 PIC X(7) USING ORDER-NO. COBOL

  15. Level-number [ screen-name ] [ BLANKSCREEN ] [ location – specification ] [ BLANKLINE ] [ BELL ] UNDERLINE REVERSE-VIDEO HIGHLIGHT BLINK field-specification [ BLANK WHEN ZERO ] JUSTIFIED JUST RIGHT [ AUTO] [ SECURE] [ REQUIRED] [ FULL ] General Format of Elementary item in screen section :: COBOL

  16. Level-number [ screen-name ] [ AUTO] [ SECURE] [ REQUIRED] [ FULL ] General Format of Group item in screen section:: COBOL

  17. When BLANK SCREEN is specified, the entire screen is erased and the cursor is placed in the home position(1 1). BLANK LINE erases the part of the current line starting from the current position to the end of the line. When the BELLis used, an audible alarm is sounded when the said screen field is to be accepted. UNDERLINE means that the characters in the said screen field should be displayed with underline. COBOL

  18. REVERSE-VIDEO(applies only to characters) means that the character will appear in black on white background instead of the usual white on black background. HIGHLIGHT means that the characters will appear in bold form BLINKmeans that the character will be flashed and erased alternately when displayed on screen. AUTO, SECURE, REQUIRED and FULL correspond to AUTO-SKIP, NO-ECHO, EMPTY-CHECK, LENGTH-CHECK described in connection with ACCEPT verb with position specification. COBOL

  19. THANK YOU COBOL ARJUN K G 4SN10MCA05

More Related