Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 4: IDENTIFICATION DIVISION & ENVIRONMENT DIVISION


ENVIRONMENT DIVISION

  • The ENVIRONMENT DIVISION is used to define input/output files to be used in program and to describe devices used to compile, execute the program
  • When coded, ENVIRONMENT DIVISION must follow IDENTIFICATION DIVISION
  • The ENVIRONMENT DIVISION is optional to specify
  • This ENVIRONMENT DIVISION is required in programs that processes files
  • Among all four division this one is the most machine-dependent division i.e. when program is moved from one system to another system this is the only division that may need change
  • The ENVIRONMENT DIVISION has two sections:-
    1. CONFIGURATION SECTION
    2. INPUT-OUTPUT SECTION
  • The basic structure of ENVIRONMENT Division is given below:-

    ENVIRONMENT DIVISION. [CONFIGURATION SECTION. [SOURCE-COMPUTER. source-computer-entry.] [OBJECT-COMPUTER. object-computer-entry.] [SPECIAL-NAMES. special-names-entry.]] [INPUT-OUTPUT SECTION. [FILE-CONTROL. {file-control-entry}… .] [I-O-CONTROL. {input-output-control-entry}.]]

  • The division headings, section headings and the paragraph headings must begin in Margin A and can be continued to Margin B of coding sheet
  • Each of sections and paragraph mentioned in above structure will be explained below

CONFIGURATION SECTION

  • The CONFIGURATION SECTION is used to specify the computer system on which the COBOL source program will be compiled and executed.
  • All entries in CONFIGURATION SECTION must begin in Margin A and can be continued to Margin B of coding sheet
  • The CONFIGURATION SECTION is optional to specify
  • The CONFIGURATION SECTION must not be coded in program that is contained within another program. If CONFIGURATION SECTION entries are coded in a program that contains another program they apply to each contained program
  • CONFIGURATION SECTION is explaned in detail here

INPUT-OUTPUT SECTION

  • The INPUT-OUTPUT SECTION is used to describe input and output files used by program. It is also used to specify information required for transmission of data between the external medium and the COBOL program
  • This section must be specified in all programs that use files
  • INPUT-OUTPUT SECTION and its Paragraphs, must begin in Margin A and can be continued to Margin B of coding sheet.
  • INPUT-OUTPUT SECTION is explaned in detail here



Advertisements






© copyright mainframebug.com
Privacy Policy