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

Module 4: IDENTIFICATION DIVISION & ENVIRONEMENT DIVISION


IDENTIFICATION DIVISION

  • The IDENTIFICATION DIVISION marks the beginning of COBOL program. This division is used to identify the program and also provide documentation details about the program
  • The IDENTIFICATION DIVISION is divided into several paragraphs from which the PROGRAM-ID is the only mandatory paragraph. The other paragraphs such as AUTHOR, INSTALLATION, DATE-WRITTEN, DATE-COMPILED, SECURITY etc. are optional.
  • This division is the only mandatory division in COBOL program
  • The basic structure of Identification Division is given below:-

    IDENTIFICATION DIVISION. PROGRAM-ID. program-name. [AUTHOR. programmer-name.] <---Optional [INSTALLATION. installation-name.] <---Optional [DATE-WRITTEN. dd/mm/yy.] <---Optional [DATA-COMPILED. dd/mm/yy.] <---Optional [SECURITY. confidentiality-level.] <---Optional

  • As shown in above structure, this division starts with header IDENTIFICATION DIVISION followed by a separator period (.)
  • This division contains multiple paragraphs and each starts with the paragraph header name (reserved words like PROGRAM-ID) followed by the separator period (.) followed by the paragraph name (user-defined) and ends with the separator period (.)
  • The division header and all paragraph names must begin in Margin A and can be continued to Margin B of coding sheet
  • Let’s understand each paragraph in detail

PROGRAM-ID Paragraph

  • It is used to identify program name to the operating system or compiler
  • Only mandatory paragraph in COBOL program
  • program-name can be 1-8 characters
  • This paragraph can be qualified with keywords RECURSIVE, COMMON or INITIAL. Specified RECURSIVE to call the program itself. Specified as COMMON so that this contained program can be called by containing program or any program in containing the program. Specified as INITIAL to keep this program working in the initial state whenever it is called.
  • During compilation process, load module will be created with same name as specified in program-name
  • The same program-name is used in JCL or PPT entries to execute the COBOL program.

AUTHOR Paragraph

  • It is used to specify the programmer-name who wrote the program
  • It is optional to specify
  • programmer-name is user defined and contains any character from character set

INSTALLATION Paragraph

  • It is used to specify the installation-name to describe the name of the location or company where it is installed
  • It is optional to specify

DATE-WRITTEN Paragraph

  • It is used to specify actual date on which the program was written
  • It is optional to specify

DATE-COMPILED Paragraph

  • It is used to specify date on which the program is compiled
  • It is optional to specify
  • Compiler has ability to automatically fill this field during compilation time

SECURITY Paragraph

  • It is used to specify the confidentiality of the program
  • It is optional to specify

Example illustrating use of IDENTIFICATION DIVISION:-

000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. IDNFNDIV. 000300 AUTHOR. JIMMY. 000400 INSTALALTION. MFBUG LABORATIRIES-2019. 000500 DATE-WRITTEN. 08/07/18. 000600 DATE-COMPILED. 08/08/19. 000700 SECURITY. PRIVATE. 000800 PROCEDURE DIVISION. 000900 MAIN-PARA. 001000 DISPLAY 'IDENTIFICATION DIVISION EXAMPLE' 001100 STOP RUN.






© copyright mainframebug.com
Privacy Policy