HP 3000 Manuals

Procedure Division [ Micro Focus COBOL Language Reference - Additional Topics ] MPE/iX 5.0 Documentation


Micro Focus COBOL Language Reference - Additional Topics

Procedure Division 

Literals as CALL Parameters 

Literals can be used as parameters to CALL statements.

The EXIT PROGRAM Statement 

The EXIT PROGRAM statement closes all files that the subprogram being
exited has open, if you set the RM system directive when you submit your
source code to your COBOL system.

However, if you specify the RM"ANSI" directive, the EXIT PROGRAM
statement does not do this.

Bound Checking 

If you set the RM system directive when you submit your source code to
your COBOL system, table subscripts are not bound checked.

Size Allocation for Index Data Items 

Two bytes are allocated to index data items, instead of the normal four,
if you set the RM system directive when you submit your source code to
your COBOL system.

The ACCEPT Statement 

General Format.   

The following format of the ACCEPTstatement is supported:

[]
Syntax Rules. 1. Identifier-3, identifier-4 and identifier-5, if specified, must be integer identifiers. Literal-2, literal-3 and literal-5, if specified, must be integer literals. 2. Literal-5 must be a single character. General Rules. 1. This format is treated as equivalent to Format 5 of the ACCEPT statement in the chapter Program Definition in your Language Reference, but multiple operands are allowed. The DISPLAY Statement General Format. The following format of the DISPLAY statement is supported:
[]
Syntax Rules. 1. Identifier-3, identifier-4 and identifier-5, if specified, must be integer identifiers. Literal-2, literal-3 and literal-5, if specified, must be integer literals. 2. Literal-5 must be a single character. General Rules. 1. This format is treated as equivalent to Format 3 of the DISPLAY statement in the chapter Program Definition in your Language Reference. Non-Standard Operations on Alphanumeric Data Items Alphanumeric values can be stored in numeric data items, but will be right justified (as is normal with a numeric receiving item) and space-filled on the left. For example, if "AB" is moved to an item decribed as PIC 9(5), the value stored will be "AB". OPEN and CLOSE on SEQUENTIAL Files The RM/COBOL language permits OPEN and CLOSEstatements to be specified with NO REWIND on a sequential file. In the standard COBOL language, such statements are treated as documentary only. The PERFORM Statement Your COBOL system normally uses a stack for handling PERFORM statements, while the RM/COBOL system associates a return address with a specific procedure name. As a result, under the RM/COBOL system all end-points of PERFORM statements are active until they are used, whereas under your COBOL system only the end-point of the innermost current PERFORM statement is active at any one time. However, if the PERFORM-TYPE"RM"directive is set, your COBOL system will handle PERFORM statements in the way RM/COBOL does. See your COBOL System Reference for details of this directive. Procedure Names Programs can contain procedure-names that are the same as data-names. REWRITE on LINE SEQUENTIAL Files The REWRITEstatement can be used on sequential files, providing the new record is the same length as the original. The STOP RUN Statement General Format. The following format of the STOP RUN statement is supported:
[]
Syntax Rules. 1. identifier must be a numeric integer data item. 2. literal must be a numeric integer. General Rule. The value held in the numeric integer data item or the value of the literal is placed in a special register RETURN-CODE. File I-O Status Codes COBOLI-O statuscodes are mapped onto their RM equivalents if you specify the RM system directive when you submit your source files to your COBOL system. See your COBOL System Reference for more details. Locked Records If you specify the RM system directive when you submit your source files to your COBOL system and a record is found to be locked, the following happens: * If the file has an applicable Declaratives Sectionand it has a file status value associated with it: * processing is transferred to the Declaratives Section * the record area contains the correct record from the read * the I-O status code indicates the "record locked" condition * If the file has no applicable Declaratives Section or file status value associated with it, the locked record is continually retried until its lock is released.


MPE/iX 5.0 Documentation