Previous Topic: How Information Is PassedNext Topic: Coding an Assembler procedure module


Coding a COBOL Procedure Module

The following module adds two numbers and returns the result to the main CA Culprit program.

Procedure Module

IDENTIFICATION DIVISION.
PROGRAM-ID. CULLUS97.
INSTALLATION. COMPUTER ASSOCIATES
DATE-WRITTEN. MONTH YYYY.
REMARKS. THIS IS A TEST OF A COBOL PROCEDURE MODULE
         FOR A CULPRIT JOB.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-370.
OBJECT-COMPUTER. IBM-370.
DATA DIVISION.
LINKAGE SECTION.
01  CULARG-INPUT            PIC X.
01  CULARG-1                PIC S9(15) COMP-3.
01  CULARG-2                PIC S9(15) COMP-3.
01  CULARG-3                PIC S9(15) COMP-3.
PROCEDURE DIVISION USING CULARG-INPUT
                         CULARG-1
                         CULARG-2
                         CULARG-3.
0010-CONTROL.
    ADD CULARG-1 CULARG-2 GIVING CULARG-3.
    GOBACK.