• Rajesh A R

F1 for Mainframe

F1 for Mainframe

Tag Archives: division

COBOL program format

10 Saturday Mar 2012

Posted by rajeshar in COBOL

≈ Leave a comment

Tags

COBOL, data, division, environment, file control, identification, mainframe, procedure

COBOL program format

IDENTIFICATION DIVISION, which identifies the program with a name and, if you want, gives other identifying information.

IDENTIFICATION DIVISION.

Program-ID. Helloprog.

Author. A. Programmer.

Installation. Computing Laboratories.

Date-Written. 08/21/2002.

ENVIRONMENT DIVISION, where you describe the aspects of your program that depend on the computing environment.

The configuration section is an optional section for programs and classes, and can describe the computer environment on which the program or class is compiled and executed.

ENVIRONMENT DIVISION.

CONFIGURATION SECTION.

 SOURCE-COMPUTER. computer-name.

 OBJECT-COMPUTER. computer-name.

 SPECIAL-NAMES.   special-names-entries.

INPUT-OUTPUT SECTION.

FILE-CONTROL.

SELECT [OPTIONAL] file-name-1   ASSIGN TO system-name [FOR MULTIPLE {REEL | UNIT}]   […. .  I-O-CONTROL.   SAME [RECORD] AREA FOR file-name-1 … file-name-n.

DATA DIVISION, where the characteristics of your data are defined in one of the following sections in the DATA DIVISION:

    • FILE SECTION, to define data used in input-output operations
    • LINKAGE SECTION, to describe data from another program.

When defining data developed for internal processing:

    • WORKING-STORAGE SECTION, to have storage statically allocated and remain for the life of the run unit.
    • LOCAL-STORAGE SECTION, to have storage allocated each time a program is called and de-allocated when the program ends.
    • LINKAGE SECTION, to describe data from another program.

DATA DIVISION.

FILE SECTION.

FD filename  01 recordname   nn . . . fieldlength & type   nn . . . fieldlength & type  . . .

WORKING-STORAGE SECTION

01 file-status PICTURE 99.  . . .

PROCEDURE DIVISION, where the instructions related to the manipulation of data and interfaces with other procedures are specified.

The PROCEDURE DIVISION of a program is divided into sections and paragraphs, which contain sentences and statements, as described here:

    • Section – a logical subdivision of your processing logic. A section has a section header and is optionally followed by one or more paragraphs. A section can be the subject of a PERFORM statement. One type of section is for declaratives.

Declaratives are a set of one or more special purpose sections, written at the beginning of the PROCEDURE DIVISION, the first of which is preceded by the key word. DECLARATIVES and the last of which is followed by the key word END DECLARATIVES.

    • Paragraph – a subdivision of a section, procedure, or program. A paragraph can be the subject of a statement.
    • Sentence – a series of one or more COBOL statements ending with a period.
    • Statement – a defined step of COBOL processing, such as adding two numbers.
    • Phrase – a subdivision of a statement.

PROCEDURE DIVISION.

. . .

OPEN iomode filename

. . .

READ filename

. . .

WRITE recordname

. . .

CLOSE filename

. . .

STOP RUN.

————————————————————————————————————

If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog

  • You may also like to look at:
    Important SQL CODES and ABEND CODES
    SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
    KNOW YOUR MAINFRAME
    REXX – INITIAL SETUP
    HOW TO SUBMIT A BATCH JOB FROM THE CICS PROGRAM
    CICS – EXEC interface block – EIBRESP Values
    CICS – EXEC interface block Fields
    Flow of control between COBOL programs, run units, and CICS
    CICS INTERVIEW QUESTIONS
    CICS TIPS
    COBOL – COPY and INCLUDE statements
    COBOL – PERFORMANCE IMPROVEMENT
    COBOL – SIGN STORED IN COMP, COMP-3 AND DISPLAY FORMATS
    SHORTEST COBOL PROGRAM
    RESTART LOGIC IN COBOL DB2 Program
    GOBACK – EXIT PROGRAM – STOP RUN
    Continuation lines in COBOL
    Computational items – COMP, COMP 1 , COMP 2, COMP 3
    COBOL program format
    cobol indicator area column-7 and area a and area b
    COBOL INTERVIEW QUESTIONS
    COBOL TIPS
    COBOL COMPILER OPTIONS
    The IDENTIFICATION DIVISION

     

Advertisement

Rate this:

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • November 2020
  • July 2020
  • February 2020
  • January 2020
  • September 2019
  • August 2019
  • October 2018
  • April 2018
  • March 2018
  • December 2017
  • October 2017
  • August 2017
  • July 2017
  • June 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • May 2016
  • March 2016
  • February 2016
  • January 2016
  • May 2015
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • January 2013
  • December 2012
  • November 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • April 2011
  • March 2011
  • August 2009
  • June 2009
  • April 2009

Categories

  • Azure
  • CA7
  • CICS
  • COBOL
    • Keywords
  • DB2
  • EASYTRIEVE
  • FILEAID
  • FILEMAXX
  • IMS
  • ISPF
  • JCL
  • KNOW YOUR MAINFRAME
  • Mainframe Migration
  • MAINFRAMES
  • Others
  • REXX
  • SDSF
  • SORT
  • Training
  • TSQL
  • VSAM

Meta

  • Register
  • Log in

Blog at WordPress.com.

  • Follow Following
    • F1 for Mainframe
    • Join 88 other followers
    • Already have a WordPress.com account? Log in now.
    • F1 for Mainframe
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar