|IBM/370 Mainframe Compatibility||Rebuild|
Conversion Series 2 supports certain extensions which allow you to submit source programs written in Microsoft COBOL Version 2.2 directly to this COBOL system. This chapter describes the directives you may need to set to submit your Microsoft V2.2 programs to this COBOL system, and also gives hints on how to avoid possible areas of difficulty when you submit your programs.
Microsoft COBOL V2.2 is a DOS system. The compatibility issues described in this Part, however, apply to all versions of this COBOL system, with the following restriction:
Restriction: Data file conversion using Rebuild, and the Microsoft COBOL V2.2 extension routines, are not supported in UNIX versions of this COBOL system.
Before submitting your Microsoft COBOL V2.2 programs to this COBOL system, you must:
For further details of these directives, see your Object COBOL User Guide.
Under DOS and OS/2, this can be done by selecting the Microsoft COBOL V2.2 option from within the Setup Utility. Under UNIX it must be done manually.
When you have configured this COBOL system, you can then submit your Microsoft COBOL Version 2.2 programs to it. For the command to do this, see your Release Notes.
Most of the Microsoft COBOL Version 2.2 programs which you submit to this COBOL system will be accepted syntactically and will run successfully. However, incompatibilities may occur in a number of areas.
In some minor cases, this COBOL system will produce errors when encountering missing periods or spelling errors (for example, SOURCE COMPUTER in place of SOURCE-COMPUTER is not acceptable).
The sections below detail the known features which could produce errors, or which may not behave in the way you expect, along with hints on how to rectify the cause of such errors, or emulate the behavior of Microsoft COBOL Version 2.2 programs.
This condition occurs if the standard TAB settings on the Microsoft COBOL Version 2.2 Compiler have been changed either by patching the run-time system, or by using the /O directive.
Before submitting your Microsoft COBOL Version 2.2 program to this COBOL system, process the program with the tabx utility (see the chapter Converting an RM/COBOL Application in the Conversion Series 3 Part for details of how to do this). This expands any tab characters into spaces. You can then successfully submit your source programs to this COBOL system.
Under this COBOL system, unsigned COMP-3 fields produce different sign representation from that of Microsoft COBOL Version 2.2.
You must ensure that you specify the MS"2" system directive which will cause unsigned COMP-3 fields to be treated in the same way as they were under Microsoft COBOL Version 2.2; that is, as signed positive. This directive is automatically set by the Setup utility if you select the Microsoft Version 2.2 option.
Any declaratives statement which appears after a paragraph header is rejected when you submit your program to this COBOL system.
This COBOL system insists that the declaratives statement immediately follows the section header, rather than the paragraph header. Amend your source program and resubmit it to this COBOL system.
You may receive an error on the SPECIAL-NAMES paragraph header when you submit your program to this COBOL system.
When you submit your program to this COBOL system, ensure that the SPECIAL-NAMES paragraph is inside the Environment Division.
The EJECT IS ... statement in the SPECIAL-NAMES paragraph is rejected when you submit your program to this COBOL system.
Replace the word EJECT with the word FORMFEED .
Items with PICTURE clauses such as "-.ZZ" may produce errors when you submit your program to this COBOL system.
If you receive errors for picture-strings which contain a "-" (minus) followed by a " . " (period), or a " . " followed by a "Z", either alter the "Z" characters to "?" characters, or add a BLANK WHEN ZERO clause.
The SEGMENT-LIMIT IS ... clause is treated as documentary by this COBOL system, although this should not produce any problems. However, segmentation is an out-dated feature of COBOL and is treated by the ANSI standard as an obsolete feature.
Certain usage of the REDEFINES clause in a Microsoft COBOL Version 2.2 program will produce errors when you submit your program to this COBOL system. For example:
03 A. ... 03 B. ... 03 C REDEFINES A.
is not accepted by this COBOL system because C is not the next item of the same level after A.
In the above example, move the redefinition so that it is the next item of the same level, after the item it is redefining.
A VALUE clause on an INDEX data item will produce errors when you submit your program to this COBOL system.
Remove the VALUE clause and use the SET statement at the start of the Procedure Division to supply an initial value to the INDEX data item.
Incorrect filenames are being used by programs when you run them under this COBOL system.
All filenames under this COBOL system must be terminated by a space, whereas under Microsoft COBOL Version 2.2, a file-name must be terminated by a null byte.
When opening a nonexistent file EXTEND, this COBOL system, unlike Microsoft COBOL Version 2.2, does not create the file.
You can solve this by placing the word OPTIONAL after the word SELECT for this file.
Check for the `Record locked' status and loop back to re-read the record.
Records in a relative file are not deleted by this COBOL system if they are rewritten with the first byte containing LOW-VALUES.
In accordance with the warning in the Microsoft manual, we recommend that you do not use this feature of the Microsoft COBOL Version 2.2 system, but if you have used it, you should be able to replace the relevant program logic with a simple DELETE statement .
The current version of Rebuild does not allow you to reorganize files so that the keys are in descending order.
If any of your programs rely on this ordering of the records, it can be simulated by first positioning on the last record in the file (using a START <= statement with HIGH-VALUES in the key) and then using the READ PREVIOUS syntax.
Note: To enable the READ PREVIOUS syntax , you must specify the MF"3" system directive, although when you do, it enables some other reserved words. See your Language Reference for details of these reserved words.
The READY TRACE and RESET TRACE statements do not have any effect under this COBOL system.
You should specify the directive TRACE when you submit your program to this COBOL system and these statements will function correctly.
Under this COBOL system, when a subprogram is not found, an ON OVERFLOW phrase on the CALL statement does not cause the program to stop with an error. Instead, the ON OVERFLOW path is followed if the subprogram is not found (and also if there is insufficient memory).
It is very unlikely that any application is relying on a program to stop with a fatal error. However, if this is the case, you should change the logic in the ON OVERFLOW phrase to handle this.
Note: An error made when coding the program-name may cause the ON OVERFLOW phrase to be followed rather than stopping; this is something of which you should be aware.
Integer numeric fields are accepted differently because numeric edited fields insert digits from right to left under this COBOL system.
Change the picture-string on this COBOL system from 9(n) to Z(n) and the insertion behavior will be the same as under Microsoft COBOL Version 2.2.
Note: Numeric operations cannot be performed on a numeric edited field. If you do wish to perform numeric operations on this item, you must move it to a numeric item.
Alphabetic fields do not allow non-alphabetic characters to be accepted into them under this COBOL system.
Change the PIC A(
n) of the field in question to PIC X(
The Screen Section syntax, numeric-edited-item FROM group-item, does not convert to edited format under this COBOL system.
Make the object of the FROM phrase an elementary numeric item and redefine it if the individual components are required.
The Screen Section clause COLUMN PLUS 1 does not give the correct intervening space under some circumstances. For example, the lines:
02 line 1 column 1 .... 02 column plus 1 ....
will not put a space in column 2.
You should include an explicit LINE clause in the line in error. For example:
02 line 1 column 1 .... 02 line 1 column plus 1 ....
Under this COBOL system, your Microsoft COBOL Version 2.2 programs do not clear the screen automatically at the start of a run.
If you want this to happen, you can insert the statement:
at the start of the Procedure Division.
The screen is sometimes scrolled when a program terminates. This happens only if the cursor is on the last line of the screen when the STOP RUN statement is obeyed, and is caused by a request for the operating system prompt.
Simply include the following CALL statement immediately before the STOP RUN statement to position the cursor away from the last line:
call x"e6" using result, parameter
For details of this subroutine, see your Programmer's Guide to Creating User Interfaces.
When you try to sound the bell by displaying an item containing hexadecimal 7, under this COBOL system, a diamond appears on the screen instead. This is because the functionality of the ACCEPT/DISPLAY module has been changed (and considerably enhanced) in this COBOL system.
To sound the bell, change this DISPLAY statement in your source program to the statement:
The following Microsoft COBOL Version 2.2 extension subroutines have been implemented in a slightly different way on the 16-bit COBOL system:
To avoid a possible clash with other dialects, the subroutine-names have been prefaced with _MS (underscore MS), and the length of parameters must be passed to the routines (this is performed by the LENGTH OF syntax). Therefore, the subroutine:
call "EXIST" using file-name, status
call "_MSEXIST" using file-name, LENGTH OF file-name, status
call "RENAME" using old-file-name, new-file-name, status
call "_MSRENAME" using old-file-name, LENGTH OF old-file-name, new-file-name, LENGTH OF new-file-name, status
call "REMOVE" using file-name, status
call "_MSREMOVE" using file-name, LENGTH OF file-name, status
call "COMMAND" using command-line
call "_MSCOMMAND" using command-line, LENGTH OF command-line
call "UPCASE" using data-name, number-of-chars-to-convert, status
call "_MSUPCASE" using data-name, LENGTH OF data-name, number-of-chars-to-convert, LENGTH OF number-of-chars-to-convert, status
call "LOCASE" using data-name, number-of-chars-to-convert, status
call "_MSLOCASE" using data-name, LENGTH OF data-name, number-of-chars-to-convert, LENGTH OF number-of-chars-to-convert, status
call "EXCODE" using exit-code
call "_MSEXCODE" using exit-code, LENGTH OF exit-code
call "KBDAVAIL" using status
call "_MSKBDAVAIL" using status
and the subroutine:
call "CURPOS" using line-number, column-number
call "_MSCURPOS" using line-number, column-number
The LENGTH OF syntax used in the way indicated here will produce a Warning level error message. This message will appear only if you set the warning level to 2 or 3 using the WARNING directive. The message can be ignored.
The range of Micro Focus add-on products available for use with this system is designed to work with the default system configuration. You should, therefore, be aware that if you use any of these add-on products and you submit your program to a system with a different configuration, the results may be unpredictable.
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
|IBM/370 Mainframe Compatibility||Rebuild|