Program Identification COBOL

Program Identification

The Identification Division must begin with the reserved words IDENTIFICATION DIVISION or ID DIVISION followed by a separator period.

Paragraph headers identify the type of information contained in the paragraph. The name of the program must be given in the first paragraph, which is the PROGRAM-ID paragraph. The other paragraphs are optional and may be written in any order.

PROGRAM-ID Paragraph

PROGRAM-ID Paragraph

A constant-name may not be used for literal-1. A constant-name used in place of literal-1 will be treated as a program-name;the literal value assigned to the constant-name will not be used.

The PROGRAM-ID paragraph, containing the program-name, identifies the source program, the object program, and all listings pertaining to a particular program. program-name-1 is a user-defined word. Alternatively, program-name-1 may be specified as a nonnumeric literal, in which case the value of program-name-1 may be a reserved word or may use any characters in the character set of the computer. A program contained within another program must not be assigned the same name as that of any other program contained within the separately compiled program that contains this program.

program-name-1 may be 1 to 30 characters in length.All the characters of program-name-1 , except trailing spaces, are associated with the object program in order to identify the program to be called or canceled by a CALL or CANCEL statement.

The PROGRAM-ID paragraph also assigns selected program attributes to the program that it names.

The optional COMMON clause may be used only if the program is contained within another program. It specifies that the program is common. A common program is contained within another program, but may be called from programs other than that containing it. Such other calling programs must be directly or indirectly contained in the same program that contains the common program.

The INITIAL clause specifies that the program is initial. When an initial program is called, it and any programs contained within it are placed in their initial state. When an EXIT PROGRAM or GOBACK statement is executed in an initial program, the program is implicitly canceled.

AUTHOR, INSTALLATION, DATE-WRITTEN, SECURITY, and REMARKS Paragraphs

AUTHOR, INSTALLATION, DATE-WRITTEN, SECURITY, and REMARKS Paragraphs

These paragraphs are optional; their order of presentation is immaterial. They document information pertaining to the paragraph header. The paragraphs are reproduced in the listing generated by the compiler, but have no effect on the compilation.

DATE-COMPILED Paragraph

DATE-COMPILED Paragraph

If a DATE-COMPILED paragraph is present, it is replaced during compilation with a paragraph of the form:

DATE-COMPILED. current-date.

Where current-date is the date on which the compilation started. The format of current-date is determined by the LISTING-DATE-FORMAT and LISTING-DATE-SEPARATOR keywords of the COMPILER-OPTIONS configuration record. The default format is “MM/DD/YYYY”, where MM is the month of the year, DD is the day of the month,and YYYY is the year.

The entire comment-entry-4 is replaced,but comment lines in the paragraph are not replaced. Only the compilation listing file is affected; the compilation date is not inserted in the source file. The inserted compilation date matches the date placed in the object file and the date listed in the compilation listing page headers.

The DATE-COMPILED paragraph is optional and may appear in any order with respect to the other optional paragraphs of the Identification Division.



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

COBOL Topics