Compatibility with DG Interactive COBOL | RM/COBOL Conversion Issues |
NetExpress supports certain extensions that enable you to submit source programs written in the RM/COBOL language.
To convert an RM/COBOL application and make it suitable for input to this COBOL system:
To submit RM/COBOL source programs to this COBOL system which contain syntax not supported in the standard COBOL language, you must set the RM Compiler directive.
NetExpress:
See the Compiler Directives help for full details of this
Compiler directive.
Server Express:
See the chapter Directives
for Compiler in your Server Express User's Guide
for full details of this Compiler directive.
When you set the RM directive the additional syntax required, as documented in the Language Reference, is enabled.
You will need to alter your source programs only if they contain RM/COBOL features which are not supported by this COBOL system. You might also want to change your source programs if they contain features which behave differently under both COBOL systems, in order to force this system to emulate the behavior of the RM/COBOL system.
You must change any tab characters to spaces before submitting any source programs to this COBOL system.
By default, the standard COBOL language supported by this system, as documented in the Language Reference , already supports much of the RM/COBOL syntax and behavior. You can, however, enable some additional RM/COBOL syntax, using the RM Compiler directive. Setting the RM directive when you submit your RM/COBOL source programs to this COBOL system, ensures that most of the programs are accepted the first time they are submitted. The additional syntax enabled by the RM directive is documented in the Language Reference .
If you normally set the ANSI switch when you submit your RM/COBOL source programs to the RM/COBOL system, you must specify the ANSI parameter with the RM directive when you submit these programs to this COBOL system.
Setting the RM directive automatically sets additional Compiler directives, namely NOTRUNC, OLDINDEX, NOOPTIONAL-FILE, RETRYLOCK, ALIGN"2" and SEQUENTIAL"LINE".
NetExpress:
See the Compiler Directives help for details of these Compiler
directives.
Server Express:
See the chapter Directives
for Compiler in your Server Express User's Guide
for details of these Compiler directives.
The system will also behave as if you had specified the following syntax:
sign trailing separate
for signed numeric data items, and:
lock mode is automatic
for each file in the program which has no explicit locking syntax declared. When you set the RM directive with the ANSI parameter, the same Compiler directives are set as for the RM directive, except that the SEQUENTIAL directive is set as SEQUENTIAL"RECORD". Also, the system behaves as if you had specified the syntax:
sign trailing included
for signed numeric data items, and:
lock mode is automatic
for each file in the program which has no explicit locking syntax declared.
We also recommend that you set the NOMF directive when you submit your RM/COBOL source programs to this COBOL system. This ensures that only those words which are treated as reserved words under the ANSI '74 COBOL standard are regarded as reserved words by this COBOL system.
Setting the NORM directive disables the syntax enabled when the RM directive was set, and automatically resets the additional Compiler directives to NOSPZERO, TRUNC"ANSI", NOOLDINDEX, OPTIONAL-FILE, NORETRYLOCK, ALIGN"8" and SEQUENTIAL"RECORD". Additionally, the system behaves as if you had specified the syntax:
sign trailing included
for signed numeric data items, and:
lock mode is exclusive
for each file in the program which has no explicit locking syntax declared. The final states of the additional directives set when you use the NORM directive are not necessarily the same as their initial default states.
PERFORM statements are not treated in the same way by both COBOL systems. This COBOL system uses a stack-based perform handling system, 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 to PERFORM statements are always active until they are used. However, under this system, only the end-point of the last PERFORM statement is active at any one time.
You must set the PERFORM-TYPE directive with the RM parameter if this COBOL system is to emulate the behavior of RM/COBOL PERFORM statements.
If you try to run a program under this COBOL system which contains a subscript value greater than the size of the table to which it refers, the run-time system will produce an error indicating this. Under the RM/COBOL system, however, no such table bound checking is done. Therefore, if you wish to disable table bound checking in this COBOL system, you must use the NOBOUND directive.
If you use the NOBOUND directive when running intermediate code, you will be able to access data beyond a table's bounds by using a subscript value greater than the table size. Use of the NOBOUND directive when you are producing intermediate code will also disable bound checking when running generated code. However, if you wish to access data beyond a table's bounds when running generated code, you must also use the directive NOBOUNDOPT.
Note: When you use the NOBOUNDOPT directive, performance will be impaired.
This COBOL system always allocates the same number of bytes to a data item as in the original program, but might redefine its contents when it is converted. Therefore, you must be aware that if these items are redefined, and the program logic expects to find a certain binary value in the redefinition, you might not receive the behavior you are expecting at run time. At run time, this COBOL system might treat the ON SIZE ERROR clause differently from the RM/COBOL system. See the chapter RM/COBOL Conversion Issues for further details.
The following sections define how this COBOL system treats COMPUTATIONAL, COMPUTATIONAL-1 and COMPUTATIONAL-6 types of data.
This COBOL system treats any COMP data items in your RM/COBOL source program as the standard Micro Focus COBOL DISPLAY format. The difference in the internal representation of such data in the two systems is that this COBOL system always sets the most significant four bits of each byte to the value 3, while the RM/COBOL system always sets such bits to the value 0.
For example, under the RM/COBOL system:
PIC 999 COMP VALUE 123
is held in three bytes as hexadecimal value 01 02 03
while under this COBOL system:
PIC 999 VALUE 123
is held in three bytes as hexadecimal value 31 32 33.
For each data item declared as USAGE COMP-1 in your RM/COBOL source program, regardless of its picture-string, this COBOL system allocates a 2-byte signed binary data item. This data item is capable of holding a hexadecimal value in the range -32768 to +32767. That is, this COBOL system treats each RM/COBOL USAGE COMP-1 data item as though it had a standard Micro Focus COBOL picture-string of S9(4) COMP. See your Language Reference - Additional Topics for details on the standard Micro Focus COBOL language.
This COBOL system treats any COMP-6 data items in your RM/COBOL source program as the standard Micro Focus 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, this COBOL system pads the space with a byte containing a zero, as shown in the following table:
Table 6-1. COMP-6 to COMP Conversion
RM COMP-6 PICTURE clause | Bytes allocated when converting to Micro Focus COBOL COMP PICTURE clause | Number of bytes containing leading zeros required to precede COMP PICTURE clause |
---|---|---|
9(1) | 1 | NONE |
9(2) | 1 | NONE |
9(3) | 2 | NONE |
9(4) | 2 | NONE |
9(5) | 3 | NONE |
9(6) | 3 | NONE |
9(7) | 4 | NONE |
9(8) | 4 | NONE |
9(9) | 5 | NONE |
9(10) | 5 | NONE |
9(11) | 5 | 1 |
9(12) | 5 | 1 |
9(13) | 6 | 1 |
9(14) | 6 | 1 |
9(15) | 7 | 1 |
9(16) | 7 | 1 |
9(17) | 8 | 1 |
9(18) | 8 | 1 |
The padding byte precedes the converted field, and is therefore included in any redefinition of group fields which contain the converted field. However, the padding byte would not be included if you redefined only the converted field. If you wish to ensure that the padding byte is included in the redefinition of the converted field, you must add a field at a higher level immediately before the converted field, and redefine this new field instead.
NetExpress cannot process the DECIMAL POINT IS COMMA clause in the SPECIAL-NAMES paragraph. To overcome this limitation remove the DECIMAL POINT IS COMMA clause.
The maximum length of a picture-string in a record description is 20 characters. However, you can overcome this limitation by splitting any picture-strings which exceed this limit into two, and defining a FILLER item with a picture-string which corresponds to the size of the second half of the original string.
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Compatibility with DG Interactive COBOL | RM/COBOL Conversion Issues |