PreviousMicrosoft COBOL V1.0 and V2.0 Syntax Support Data General Interactive COBOL V1.3 Syntax SupportNext

Chapter 11: Ryan McFarland COBOL V2.0 Syntax Support

The syntax listed in this chapter is accepted by your COBOL system purely for compatibility with version 2.0 of Ryan McFarland COBOL. Many features found in Ryan McFarland COBOL exist already in this COBOL implementation. These are documented in your Language Reference. Some of the compatibility syntax listed in this chapter is identical to standard COBOL syntax, but behaves differently if you set the RM Compiler directive when you submit your source code to your COBOL system. See the RM/COBOL Language Reference Manual version 2.0 for a full description of the Ryan McFarland syntax.

11.1 Environment Division

11.1.1 The ASSIGN Clause

General Format

The following format of the ASSIGN clause is supported:

General Rules

  1. The words INPUT, OUTPUT, INPUT-OUTPUT, PRINT and RANDOM are treated as documentary.

11.1.2 The ORGANIZATION Clause

General Format

The following format of the ORGANIZATION clause is supported:

General Rules

  1. This clause is treated as equivalent to ORGANIZATION IS SEQUENTIAL.

    However, if you specify the RM"ANSI" Compiler directive when you submit your source code to your COBOL system, this clause is treated as equivalent to ORGANIZATION IS LINE SEQUENTIAL.

  2. If you do not specify an ORGANIZATION clause for a file then ORGANIZATION IS LINE SEQUENTIAL is assumed, providing you set the RM Compiler directive when you submit your source code to your COBOL system.

    However, if you specify the RM"ANSI" Compiler directive when you submit your source code to your COBOL system, then ORGANIZATION IS SEQUENTIAL is assumed.

11.2 Data Division

11.2.1 The VALUE OF LABEL Clause

General Format

The following clause is accepted in an FD entry:

General Rules

  1. This clause is treated as documentary.

11.2.2 Length of Nonnumeric Literals

In the Data Division, nonnumeric literals up to 2047 characters long are allowed if you set the RM Compiler directive when you submit your source code to your COBOL system.

11.2.3 Default Sign Representation

The syntax:

is assumed in the SPECIAL-NAMES paragraph if you set the RM Compiler directive when you submit your source code to your COBOL system. However, if you specify the RM"ANSI" Compiler directive when you submit your source code to your COBOL system, this phrase is not assumed.

11.2.4 The USAGE Clause

General Format

The following format of the USAGE clause is supported:

Syntax Rules

  1. COMP and COMPUTATIONAL are synonymous.

  2. COMP-1 and COMPUTATIONAL-1 are synonymous.

  3. COMP-6 and COMPUTATIONAL-6 are synonymous.

General Rules

  1. The COBOL system allocates a 2-byte signed binary data item, capable of holding values in the range –32k to +32k, for each data item declared as USAGE COMP-1 in the source program, regardless of its picture string. That is, each USAGE COMP-1 data item is treated as though it had a standard COBOL picture-string of S9(4) COMP.

  2. COMP-6 data items are converted to COBOL COMP format. If, as a result of this, less data space is allocated to each item than would be under the RM/COBOL system, the space is padded with null bytes (that is, bytes containing X"00"). See your Compatibility Guide for further details of the USAGE clause under RM/COBOL.

  3. USAGE IS COMPUTATIONAL is treated the same as USAGE IS DISPLAY.

11.3 Procedure Division

11.3.1 Literals as CALL Parameters

Literals can be used as parameters to CALL statements.

11.3.2 The EXIT PROGRAM Statement

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

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

11.3.3 Bound Checking

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

11.3.4 Size Allocation for Index Data Items

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

11.3.5 The ACCEPT Statement

General Format

The following format of the ACCEPT 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 5 of the ACCEPT statement in the chapter Program Definition in your Language Reference, but multiple operands are allowed.

11.3.6 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.

11.3.7 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".

11.3.8 OPEN and CLOSE on SEQUENTIAL Files

The RM/COBOL language permits OPEN and CLOSE statements to be specified with NO REWIND on a sequential file. In the standard COBOL language, such statements are treated as documentary only.

11.3.9 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" Compiler directive is set, your COBOL system will handle PERFORM statements in the way RM/COBOL does.

11.3.10 Procedure Names

Programs can contain procedure-names that are the same as data-names.

11.3.11 REWRITE on LINE SEQUENTIAL Files

The REWRITE statement can be used on sequential files, providing the new record is the same length as the original.

11.3.12 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 Rules

  1. The value held in the numeric integer data item or the value of the literal is placed in a special register RETURN-CODE.

11.3.13 File I-O Status Codes

COBOL I-O status codes are mapped onto their RM equivalents if you specify the RM Compiler directive when you submit your source files to your COBOL system.

11.3.14 Locked Records

If you specify the RM Compiler directive when you submit your source files to your COBOL system and a record is found to be locked, the following happens:


Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.

PreviousMicrosoft COBOL V1.0 and V2.0 Syntax Support Data General Interactive COBOL V1.3 Syntax SupportNext