The following issues may occur when compiling your RM/COBOL programs without the DIALECT"RM" Compiler directive:
Directive settings will revert to
Visual COBOL defaults. Refer to the
MF Dialect setting and
RM Dialect setting sections of the DIALECT Compiler directive topic for the differences; you can explicitly set any of the directives to override the default set by the MF dialect. You can also use the SETTINGS directive to output a list of directive settings in effect.
RM/COBOL reserved words that are not reserved in
Visual COBOL will not be treated as reserved words: this can cause errors such as "verb expected" or other such syntax errors. In some cases, you can use an ADDRSV directive to resolve this. In other cases, you must modify the syntax in the source to avoid the RM/COBOL reserved word; often there is an equivalent syntax in
Visual COBOL that uses a different reserved word.
The CRT STATUS value for ACCEPT statements will not be converted to RM/COBOL numeric values. The CRT STATUS for an ACCEPT statement will be the
Visual COBOL three-byte value, where each byte has a different meaning - the second byte frequently contains the RM/COBOL numeric value.
In the ASSIGN clause of a file control entry, the device types SORT-WORK, CARD-PUNCH, CARD-READER, CASSETTE and DISC will not be recognized as valid device types. You must modify the program to specify an equivalent device type supported by
Visual COBOL. Device types with a prefix of PRINTER and an additional character, for example, PRINTER1 or PRINTER?, will not be treated as printers; you must shorten the device type to just PRINTER.
The ASSIGN clause of a file control entry will not assume DYNAMIC when the ASSIGN directive specifies "EXTERNAL". You must either override the ASSIGN"EXTERNAL" directive, or modify the program to specify DYNAMIC explicitly in the ASSIGN clause.
Indexed file key-name references will not be implicitly qualified by the file-name in the file control entry or READ/START statements. Ambiguous reference errors may occur if the qualification is required for uniqueness of reference when the same key-name has been used for more than one file; in this case you must explicitly add the qualification
OF file-name to the reference for
Visual COBOL.
The CODE-SET clause is not allowed in the file control entry; it can be specified only in the file description entry. Move any CODE-SET clause specified in the file control entry to the file description entry.
COLLATING SEQUENCE clauses may be repeated in the file control entry for an indexed file and the lexically last such clause specified takes precedence.
Constant-expressions are fully supported for RM/COBOL syntax in
Visual COBOL, but
Visual COBOL computes a 64-bit result, as opposed to RM/COBOL's 32-bit result. This is only a problem if the expression or any sub-expression result exceeds 32 bits in the RM/COBOL program; in this case,
Visual COBOL will likely have a different result.
Empty groups are not allowed. Modify the program to eliminate empty groups by including a subordinate data item in the group or by removing the group itself. A warning message
COBCH0217 or
COBCH0256 is produced for an empty group when DIALECT"RM" is set, but a severe error
COBCH0217 or
COBCH0256 is produced when DIALECT"RM" is not set.
Byte-storage mode is used for binary data items, which can result in different length file records and redefinition issues. The IBMCOMP directive will restore word-storage mode, but will also cause length specifiers in data description entries to increase to the word size that is at least as large as the length specifier, which is different from RM/COBOL behavior. A better solution might be to provide length specifiers for all binary data item usage clauses.
RECORD DELIMITER IS LINE-SEQUENTIAL or BINARY-SEQUENTIAL does not set the record delimiting technique for the file. Specify the record delimiting technique in the ORGANIZATION clause or with the SEQUENTIAL directive.
VALUE OF LABEL data-name-1 is allowed, but treated as documentary. If data-name-1 is not defined in the program, it will not be defined implicitly. In this case, any references to data-name-1 will receive compilation errors, and you must change the program to remove the reference or define data-name-1 explicitly.
Records are not variable length unless records of different length are explicitly defined, even if there are OCCURS DEPENDING ON clauses in the record description entry, or the RECORD CONTAINS clause specifies a range of record sizes. You can use the RECMODE"RMCOBOL" directive to cause records to be variable length in the same manner as RM/COBOL.
Implicit data-name definition for forward references does not take place without the DIALECT"RM" directive, except for the external file-name data-name specified in the ASSIGN clause or the FILE-ID clause. Implicit definition relates to forward references in clauses such as CRT STATUS, CURSOR, FILE STATUS and others. The explicit definition must be added to the program to avoid compilation errors. Even with DIALECT"RM" set, an E-level error message, which can be ignored or suppressed, is generated; this error indicates that the implied definition might not be the desired definition.
The ERASE clause in a screen description entry cannot be specified without EOS or EOL. A simple ERASE clause must be changed to
BLANK SCREEN. An ERASE LINE clause must be changed to
ERASE EOL or
BLANK LINE.
The SYNCHRONIZED clause follows
Visual COBOL specifications instead of RM/COBOL specifications. This may result in file record size differences or redefinition issues. It may be necessary to insert explicit definition of slack characters in record descriptions for groups that have an odd length, especially if the group or elementary items of odd length are subject to an OCCURS clause.
The USAGE COMP/COMPUTATIONAL clause in a data description entry does not produce the informational message
COBCH1210 COMP processed as DISPLAY (future occurrences not indicated).
Procedure Division headers that specify a nonnumeric returning or giving data item are not permitted unless there is a prototype that specifies the RM call-convention (1024).
Procedure-names cannot be the same as data-names. When DIALECT"RM" is set, a procedure-name that is the same as a data-name produces an informational
COBCH0305 message; when DIALECT"RM" is not set, a procedure-name that is the same as a data-name produces a serious
COBCH0305 message and the two categories of names must be disjoint in the source program.
A comparison of a nonnumeric literal that contains only digits to a display unsigned numeric data item or literal does not preserve RM/COBOL behavior.
Character set handling for files does not preserve RM/COBOL behavior.
I/O statements that result in a serious error at run time do not terminate the program when there is no applicable declarative but a file status data item is declared. The file status data item must be checked after each I/O statement to see if a serious error has occurred.
I/O defaults to expect
Visual COBOL file formats. You need to set the FILETYPE"21" directive for I/O with existing RM/COBOL format files or convert those files to Micro Focus format files.
Note: Converting the file format does not convert the format of data items in the file. If the data items are not also converted, directives that define data format may be required, such as COMP"UNPACKED", COMP1"BINARY", COMP6"3", IBMCOMP and SIGN"EBCDIC".
If FILETYPE"21" is not specified, I/O status values will be different than in RM/COBOL.
ACCEPT/DISPLAY syntax and behavior differs significantly, requiring revision of the source program to achieve behavior expected from the RM/COBOL program. Some of the revisions for behavior might not be necessary if the RM/COBOL
ADISCTRL and
COBKEYMAP files are used, but
Visual COBOL does not send all the forms of ACCEPT/DISPLAY to ADIS; the CONSOLE IS CRT clause or the DISPLAY"CRT" directive might resolve this issue. Also:
Pop-up windows are not available without setting DIALECT"RM".
The TAB syntax for ACCEPT can be restored with an ADDRSV"TAB" directive.
The reverse syntax for ACCEPT/DISPLAY can be restored with an ADDRSV"REVERSE" directive.
The ACCEPT statement will not allow the ERASE phrase; a separate DISPLAY SPACE ERASE statement before the ACCEPT is required.
The
Visual COBOL defaults will apply with respect to the MODE IS BLOCK, HIGH-LIGHT, BEEP and ECHO.
The UNIT and ECHO phrases are not supported without setting DIALECT"RM".
ACCEPT/DISPLAY statements with a group operand for the primary operand produce a
COBCH1654 Should be elementary; MODE IS BLOCK assumed when certain phrases are used. When the error does not occur, the group operand will be treated similar to a screen ACCEPT/DISPLAY, with elementary items being the fields and FILLER items treated as empty space between fields on the screen. You must add the MODE IS BLOCK phrase to such ACCEPT/DISPLAY statements to obtain RM/COBOL behavior of treating the group as a single field.
ACCEPT/DISPLAY statements position fields on the screen as explained for
Visual COBOL and not as they are for RM/COBOL. The program must be modified to make the positioning behave as desired.
ACCEPT statements that specify the ON EXCEPTION identifier-1 syntax do not compile. The identifier-1 item in the ON EXCEPTION phrase must be removed. The data item referenced by the CRT status clause, which may need to be added, can be used to obtain the status of the ACCEPT statement, but be aware that its format is not the same as identifier-1 as specified in the ON EXCEPTION phrase. When DIALECT"RM" is set, the format of the CRT status data item is converted to match RM/COBOL's format if the ON EXCEPTION phrase is specified in the ACCEPT statement.
ACCEPT statements that specify UPDATE or CONVERT revert to
Visual COBOL behavior for these phrases.
ACCEPT statements cannot specify ERASE. The ERASE must be performed in a separate DISPLAY statement preceding the ACCEPT statement. This is also true of using the CONTROL phrase to specify ERASE in the control-string specified in the CONTROL phrase.
ACCEPT statements do not beep by default. The RM"BEEP" directive can be specified to restore the RM/COBOL default beep, but that will also set old RM compatibility. Instead, you should modify the program to specify BEEP in ACCEPT statements where BEEP is desired.
CALL statements cannot specify figurative constants or symbolic characters in the USING phrase.
CALL statements with numeric literals as arguments might not preserve the original form of the literal as specified in the source for the actual argument value.
CALL statements do not use an alignment of 1 for BY CONTENT temporaries, but instead align the temporary variable per the value of the ALIGN directive.
CALL statements must have a numeric RETURNING/GIVING argument. The RM/COBOL feature of any type for RETURNING/GIVING arguments is not supported except when the 1024 call-convention is specified.
CALL "SYSTEM" is not RM/COBOL compatible unless the call-convention is set to 1024, either by the DEFAULTCALLS"1024" directive, a prototype for SYSTEM that specifies the 1024 call-convention, or an explicit call-convention specified in the CALL statement.
CANCEL of non-nested program behaves as if the program were nested in an IL program.
CLOSE statements for a line sequential file cannot specify the NO REWIND phrase.
DELETE FILE statements do not perform a USE procedure declared for the file when an error occurs.
DISPLAY statements that specify a figurative constant with positioning information and do not specify the SIZE phrase are not converted to a single-byte literal.
The WITH NO ADVANCING phrase for simple (ANSI) ACCEPT and DISPLAY statements is not handled in the same way as in RM/COBOL when the DISPLAY"CRT" directive is set and DIALECT"RM" is not.
MOVE statements that move a nonnumeric literal, including a figurative constant, that contains non-digit characters to a numeric item, substitute 0 for the sending item and produce a
COBCH1026 Source literal is nonnumeric - substituting zero error. The nonnumeric literal should be changed to contain only digits or not be used as the sending item in a MOVE operation to a numeric data item.
MOVE statements that move a nonnumeric data item to a display unsigned numeric item do not preserve RM/COBOL behavior.
OPEN statements set retry lock unconditionally, which differs from RM/COBOL behavior, where this is conditional on there being a USE procedure and file status data item.