Introduction to Program Definition | Environment Division |
The Identification Division identifies the source program and the resultant output listing. The user can include the date the program is written and such other information as desired under the paragraphs in the General Format shown on the next page.
This entire division (including the division header) is optional.
The AUTHOR, INSTALLATION, DATE-WRITTEN , DATE-COMPILED, and SECURITY paragraphs are classed as obsolete elements in the ANSI'85 standard and may be deleted from the next full revision of the ANSI Standard.
All dialects in this COBOL implementation fully support this syntax. The FLAGSTD Compiler directive can be used to detect all occurrences of this syntax.
Although they are a part of the standard COBOL definition, the obsolete paragraphs are explicitly excluded from the X/Open COBOL language definitions and should not be used in a conforming X/Open source program.
Paragraph headers identify the type of information contained in the paragraph. The name of the program must be given in the PROGRAM-ID paragraph. The other paragraphs are optional and can be included in this division at the user's choice, in the order of presentation shown by the general format below.
The General Format of the paragraphs in the Identification Division is given below.
Paragraphs can appear in any order.
If the Compiler directive SOURCEFORMAT is specified as FREE, the comment-entry cannot be continued; the next line will begin the next non-comment entry.
The comment-entry can contain the SKIP1, SKIP2, SKIP3, EJECT or TITLE statements anywhere on the line. These statements will be actioned if they are alone on a line in the comment-entry, and will not terminate the comment-entry.
The comment-entry can contain the SKIP1, SKIP2, SKIP3, or EJECT statements anywhere in the B margin. These statements will be actioned if they are alone on a line in the comment-entry, and will not terminate the comment-entry.
The comment-entry can be contained in either area A or area B of the comment-entry lines. However, the next occurrence in area A of any one of the following COBOL words or phrases will terminate the comment-entry and begin the next paragraph or division:
PROGRAM-ID
AUTHOR
INSTALLATION
DATE-WRITTEN
DATE-COMPILED
SECURITY
ENVIRONMENT
DATA
PROCEDURE
The PROGRAM-ID paragraph gives the name by which a program is identified, and assigns selected program attributes to that program.
If a hyphen is used in characters 2 through 8 of the program-name of the outermost program, it is changed to zero (0).
For programs that are contained in another program, program-name can be any valid user-defined COBOL word, up to 30 characters long. The first eight characters need not be unique, and they will not be converted as described above. Lowercase letters are valid, but such program-names will be handled in a case-insensitive manner.
The MAPNAME Compiler directive controls this behavior.
The program-name cannot be the same as another user-defined word.
A common program is one which, despite being directly contained in another program, can be called by any program directly or indirectly contained in that other progam. The common attribute is attained by specifying the COMMON clause in a program's Identification Division. The COMMON clause facilitates the writing of subprograms which are to be used by all the programs contained in a program.
An initial program is one whose program state is initialized when the program is called. Thus, whenever an initial program is called, its program state is the same as when the program was first called in that run unit. During the process of initializing an initial program, that program's internal Working-Storage data is initialized; thus an item of the program's internal data whose description contains a VALUE clause is initialized to that defined value,
but an item whose description does not contain a VALUE clause is initialized to a value depending on the DEFAULTBYTE Compiler directive.
Files with internal file connectors associated with the program are not in the open mode. The control mechanisms for all PERFORM statements contained in the program are set to their initial state. A GOTO statement referred to by an ALTER statement contained in the same program is set to its initial state. The initial attribute is attained by specifying the INITIAL clause in the program's Identification Division.
Two programs in a run unit can reference common data in the following circumstances:
Two programs in a run unit can reference common file connectors in the following circumstances:
The DATE-COMPILED paragraph provides the date the intermediate code was produced in the Identification Division source program listing.
DATE-COMPILED. current-date-and-time .
where the date and time format is DD-MMM-YY hh:mm
.
The DATE Compiler directive can impact the comment-entry replacement string for your COBOL implementation.
The value inserted in the DATE-COMPILED paragraph will also be the value used in the When-Compiled intrinsic function. However, the format can differ.
The REMARKS paragraph allows a comment-entry to be specified. (See Syntax Rule 3 under the section Identification Division earlier in this chapter.)
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Introduction to Program Definition | Environment Division |