HP 3000 Manuals

Identification Division [ COBOL/HP-UX Language Reference for the Series 700 and 800 ] MPE/iX 5.0 Documentation


COBOL/HP-UX Language Reference for the Series 700 and 800

Identification Division 

General Description 

The Identification Division identifies the source program and the
resultant output listing.  In addition, 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.
________________________________________________________________________
|(MF)                                                                  |
|This entire division (including the division header) is optional.     |
________________________________________________________________________

            
________________________________________________________________________
|(ANS85)                                                               |
|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.  |
________________________________________________________________________

            
________________________________________________________________________
|(MF)                                                                  |
|All dialects within this COBOL implementation fully support this      |
|syntax.  Refer to your COBOL System Reference for details on          |
|using the FLAGSTD directive to detect all occurrences of this         |
|syntax.                                                               |
________________________________________________________________________

            
________________________________________________________________________
|(XOPEN)                                                               |
|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.                                                       |
________________________________________________________________________

            

Organization 

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.

Structure 

The general format of the paragraphs in the Identification Division is
given below.  Paragraphs can appear in any order.  (OSVS) (VSC2)

General Format 

[]
Syntax Rules ________________________________________________________________________ |(OSVS) (VSC2) | | | | | | 1. The paragraphs can appear in any order. | | | | 2. The periods following the paragraph names within the | | Identification Division are optional as is the period following| | the program-name. | ________________________________________________________________________ 3. The comment-entry can be any combination of the characters from the computer's character set. The continuation of the comment-entry by the use of a hyphen in the continuation area is not permitted; however, the comment-entry can be contained on one or more lines but is restricted to area B of those lines. The next line commencing in area A will begin the next non-comment entry. ________________________________________________________________________ |(VSC2) | |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 within the comment-entry, and will not | |terminate the comment-entry. | ________________________________________________________________________ ________________________________________________________________________ |(OSVS) | |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 within 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 within | |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 and Nested Source Programs (ANS85). Function The PROGRAM-ID paragraph gives the name by which a program is identified, and assigns selected program attributes to that program. General Formats Format 1 PROGRAM-ID. program-name [comment-entry] (MF) ________________________________________________________________________ |(ANS85) | |Format 2 | | | | PROGRAM-ID. program-name [IS[COMMON] [INITIAL] PROGRAM]. | ________________________________________________________________________ Syntax Rules 1. The program-name must conform to the rules for formation of a user-defined word. ________________________________________________________________________ |(OSVS) (VSC2) | | | | | | | |2. The first 8 characters of program-name of the outermost program | | should be unique within the system. The first character must be | | alphabetic. If the first character is not alphabetic, it is | | converted as follows: | | | | 1 through 9 are changed to A through I respectively. | | | | Anything else is changed to J. | | | | If a hyphen is used in characters 2 through 8 of the program-name | | of the outermost program, it is changed to zero (0). | | | | This behavior is sensitive to the MAPNAME directive. See your | | COBOL System Reference for details. (MF) | | | ________________________________________________________________________ ________________________________________________________________________ |(VSC2) | |For programs that are contained within another program, program-name | |can be any valid user-defined COBOL word, up to 30 characters long. | |The first 8 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. | ________________________________________________________________________ ________________________________________________________________________ |(OSVS) (VSC2) | | | | | | | |3. The program-name can be a nonnumeric literal. The content of | | the literal must follow the rules for formation of program | | names. | | | ________________________________________________________________________ ________________________________________________________________________ |(MF) | | | | | | | |4. Comment-entry is enabled by the directive PROGID- COMMENT. See | | your COBOL System Reference for details. | | | ________________________________________________________________________ ________________________________________________________________________ |(OSVS) | | | | | | | |5. The program-name can be the same as another user-defined | | word. | | | ________________________________________________________________________ ________________________________________________________________________ |(ANS85) | | | | | | | |6. The program-name of a nested program must be unique within the | | separately compiled program containing it. | | | |7. The optional COMMON clause can be used only if the program is | | contained within another program. | | | |8. If the IS PROGRAM phrase is present, either COMMON, INITIAL or | | both must be specified. When both are specified, the order is | | irrelevant. | | | ________________________________________________________________________ General Rules 1. The program-name is associated with the object code file pertaining to this COBOL program. ________________________________________________________________________ |(MF) | | | | | | | |2. The PROGRAM-ID paragraph is optional in the outermost program. | | | |3. Whether upper-case and lower-case letters in a program-name are | | treated as identical is sensitive to the compile-time CASE | | directive. See your COBOL System Reference for details. | | | ________________________________________________________________________ ________________________________________________________________________ |(ANS85) | | | | | | | |4. The COMMON clause specifies that the program is common. A common | | program is contained within another program but can be called from| | programs other than that containing it. | | | |5. 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. See the section Initial State | | Of A Program earlier in this chapter. | | | ________________________________________________________________________ ________________________________________________________________________ |Common Programs and Initial Programs | | | |(ANS85) | | | |All programs which form part of a run unit can possess neither, one, | |or both of the common and initial attributes. A common program | |is one which, despite being directly contained within 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 within 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 programs 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 directive (see | |your COBOL System Reference). (MF) | | | |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. | |The initial attribute is attained by specifying the INITIAL clause in | |the program's Identification Division. | | | |Sharing Data | | | |Two programs in a run unit can reference common data in the following | |circumstances: | | | | | | 1. The data content of an external data record can be referenced | | from any program provided that program has described that data | | record. | | | | 2. If a program is contained within another program, both programs| | can refer to data possessing the global attribute either in the| | containing program or in any program which directly or | | indirectly contains the containing program. | | | | 3. The mechanism whereby a parameter value is passed by reference | | from a calling program to a called program establishes a | | common data item; the called program, which can use a | | different identifier, can refer to a data item in the calling | | program. | ________________________________________________________________________ ________________________________________________________________________ |(ANS85) | | | |Sharing Files | | | |Two programs in a run unit can reference common file connectors in the| |following circumstances: | | | | | | 1. An external file connector can be referenced from any program | | which describes that file connector. | | | | 2. If a program is contained within another program, both programs| | can refer to a common file connector by referring to an | | associated global file-name either in the containing program or| | in any program which directly or indirectly contains the | | containing program. | ________________________________________________________________________ The DATE-COMPILED Paragraph Function The DATE-COMPILED paragraph provides the date the intermediate code was produced in the Identification Division source program listing. General Format DATE-COMPILED. [comment-entry] ... Syntax Rule The comment-entry can be any combination of the characters from the computer's character set. The continuation of the comment entry by use of the hyphen is not permitted; however, the comment entry can be contained on one or more lines. The comment-entry lines must be contained within area B. The next line commencing in area A will begin the next non-comment paragraph. General Rule The paragraph-name DATE-COMPILED causes your COBOL system to insert a date comment-entry as the executable code is created. If a DATE-COMPILED paragraph is present (with or without a comment-entry), the paragraph is replaced in the program listing with one of the form: DATE-COMPILED. current-date-and-time. where the date and time format is DD-MMM-YY hh:mm. ________________________________________________________________________ |(MF) | |See your COBOL System Reference for details of the DATE directive | |which can impact the comment-entry replacement string for your COBOL | |implementation. | ________________________________________________________________________ ________________________________________________________________________ |(ANS85) | |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 | | | |(OSVS) | | | |The REMARKS paragraph allows a comment-entry to be specified. (See | |Syntax Rule 3 under Identification Division earlier in this | |chapter.) | ________________________________________________________________________


MPE/iX 5.0 Documentation