Review: Wang COBOL-85 |
|
From "Special Report", Access to Wang, November 1988 |
|
[ Prior Article ] [ Return to the Catalog of articles ] [ Next Article ] |
If you work in COBOL on the VS and don't live in a cave, you have undoubtedly been bombarded with information from Wang on the new COBOL 85 compiler. In my memory, no other language product has received so much attention and promotion.
There are several perspectives to take when approaching a product like COBOL 85. First, the product must be viewed as a new Wang product. Second, the introduction of new features of the ANSI COBOL 85 standard can be reviewed, along with Wang's interpretation of that standard. Finally, the product must be analyzed within the context of the VS COBOL user.
COBOL 85 requires operating system 7.00 or greater, and may require higher releases depending on the other Wang products used (PACE HLI, XDMS, etc.). Operating systems prior to 7.20 have a limit of one megabyte of static area (data items in working storage) for any program; this limit would be troublesome only for the largest programs.
Though release 1.02.04 of the debugger is required for operation, release 1.04.01 is needed to display index and unsigned packed numerics in the debugger (using the VARIABLE command). Full SORT/MERGE capabilities require release 5.10.01 of the SORT utility. Direct support of COBOL 85 in the EDITOR is provided with release 7.02.08 or with the ADEPT editor. All of these release levels are available with the operating system 7.20 distribution.
Version 1.00.02 of COBOL 85 was tested. The COBOL 85 package includes the software, a copy of the COBOL 85 Reference (715-0499) and the Programmer's Guide to COBOL 85 (800-1214). Besides the compiler itself, the software includes the runtime library for the compiler, the SETOPTS utility (described below), an optimizing system, and a lengthy installation procedure.
COBOL 85 is not a replacement for COBOL 74, and existing COBOL users will have to license the product. Unofficial 'upgrades' will be available, however, and it seems clear that Wang wants the product in the marketplace enough to concede pricing. Current list prices are $5,000, $12,500, and $20,000 for class A, B, and C processors, respectively, making this a major expense for most users.
The ANSI standard for COBOL was revised in 1985 and a new standard issued. Most of the language changes were concerned with the portability and maintainability of COBOL source code, and some vague or vendor-specific features were eliminated. The new features implemented by Wang are outlined in Figure 1 (below).
The availability of EXTERNAL data items is good news for those who wish to break large programs into smaller modules. By declaring data items as EXTERNAL, the values are available in subsequent modules without LINKAGE or other means. This will pay off in easier use of small program modules as an alternative a larger single program, and should enhance the maintainability of all of the modules.
The CALL BY CONTENT enhancement also contributes to this modularity. Previously, any passed data items in a CALL statement could be changed in the CALLed program; this was because the value was passed BY REFERENCE to a position in memory. CALL BY CONTENT preserves the original value of the variable.
If you work regularly with character string manipulations, Reference Modification will be a welcome addition. This feature allows substring capabilities similar to those of other languages. Reference Modification can be used for MOVEs, IF conditions, or at any other point in the program where a character item is referenced.
From the start, it is apparent that this product is different from any language product Wang has produced. The installation process itself gives the first clue: a very large Procedure file is included to copy and install the compiler, optimizer, and run-time libraries. Next the SETOPTS utility is used to modify the compiler's defaults, including the location of the runtime library. (Note that this library can be located on volume. For performance reasons it might be best to locate it away from the system volume.) Finally, the INFO files are installed for on-line documentation and HELP purposes. In all, a much more complicated and messy installation process - one that befits a PC product.
The reasons for these changes start to become clear when the requirements for the processing environment are considered. The release documents clearly indicate that along with this sophistication comes greater overhead. For example, a table of recommended Modifiable Data Area (MDA; a.k.a. Segment 2) space is included, showing typical user needs according to the number of lines of code and whether the optimizer is used. Due to a larger need for memory, smaller VS models may not even be able to compile programs that previously cleared the COBOL 74 compiler.
Support for COBOL 85 is provided in the most recent version of the EDITOR. As before, the compiler may also be used directly or run from a procedure. The OPTIONS screen contains many unfamiliar items, including:
COMPAT74: controls the amount of compatibility with COBOL 74. The choices are NO, 1, 2, or YES for various levels of optimizing.
RMARGIN: sets the right margin of the source code to columns 72 or 80.
PRTCOPY: prints or suppresses print of COPY files in the compiler listing.
OBS: flags items that have been identified as obsolete by the ANSI COBOL 85 specification.
OPT: the degree to which the optimizer is used.
BUFSIZE, BUFPOOL: the default buffer size and number of pool blocks.
LINKLIB, LINKVOL: the location of the static runtime library.
The next major surprise might be syntax errors with COBOL 74 program source. This compiler is much more sensitive to minor syntax problems that were allowed before. Most of the example programs I pulled from production source libraries did not compile without modification - even with the 74 compatibility switch set to YES. The large list of new reserved words was part of the problem, since some of our COPY files items new to this list.
Like most VS COBOL users, I was curious how well the compiler performed. If you are suffering performance problems, the improvements cited by Wang analysts and sales literature are enticing - particularly if some improvement can be gained without substantial programming revisions. In other words, could the performance of average code be improved simply by using this compiler?
To test the performance of COBOL 85, I used several programs that mimicked production conditions. Programs were selected that represented three categories: screen entry, calculation, and batch updates to disk files. The selected programs were typical in structure for our shop, with all I/O operations located at the physical end of the program and a large amount of unnecessary WORKING-STORAGE and PROCEDURE DIVISION sentences introduced through overuse of the COPY function.
Several compiler options were tested, including those using the COBOL 74 compatibility mode and all three levels of optimization (see Figure 2 for options). The results were gathered for all choices; for brevity I have selected a few relevant options for comparison (see Figure 3 and Figure 4, below).
The first goal was to pick the best from COBOL 74 and COBOL 85 for comparison, based on elapsed time; this proved to be the object created with the compatibility option set to level 1 (not YES) and COMPAT74 = IO (COBOL 84 with standard DMS). Repeated runs were made using both interactive and non-interactive modes. One set of runs were made with no other activity on the system, while another with a standard system load and normal amounts of file contention. As shown in Figure 3, elapsed time was barely improved but paging and disk I/O were considerably improved.
The next goal was to test the effects of the COBOL 85 compiler options. Each of the 6 option sets listed in Figure 2 are compared in Figure 4, along with a ratio comparing their performance to COBOL 74. Again, level 2 optimizing worked best for the sample program.
To sum up, performance was disappointing: the batch update program showed approximately 3 - 4% improvement in run time over the best times using 5.10.05 of COBOL 74. CPU time was virtually identical, but some disk and paging amounts improved. These proportions remained true regardless of system activity or file contention.
I should add that this sample is representative of our production programming practice - not your's. The tremendous latitude of COBOL allows extreme variation in program construction, and this can lead to dissimilar performance even when the task is the same. It's clear, though, that the rosy performance estimates in the sales literature should be treated with caution and that actual production samples from your environment should be the final arbitrator.
The decision to buy COBOL 85 should not be a hasty one. In some shops it might not make an appreciable difference in performance, and the additional language constructs may not be relevant. Certainly, the high cost of the product makes the decision less than casual. The large list price for the product is understandable considering Wang's development effort, but it will complicate the decision process.
Some of the reasons you might want to consider COBOL 85 include features like the EXTERNAL data capability, reference modification, or scope terminators. In some shops any or all of these items might simplify the coding process alone enough to justify the purchase.
In conclusion, COBOL 85 is a promising product, but it will not be a good fit in all COBOL shops. Users that are considering its purchase should try representative samples of their daily work in production situations before making a final decision.
Figure 1: Summary of COBOL 85 changes and Wang extensions
Tables of up to 7 dimensions: up from three dimensions.
Reference modification (substrings): all character items can use Reference Modification syntax to refer to portions of a character item. Example:
MOVE ANY-STRING(START-POS:CHAR-LENGTH) TO WRK-FIELD.
PERFORM. . .WITH TEST AFTER: PERFORM statements that include tests for values can now test those values after the PERFORM as well as before.
EXTERNAL data: data items can be declare EXTERNAL and are then available to all programs run by that program - without a LINKAGE SECTION, PUTPARMs, or any other coupling approach.
Explicit scope terminators: specific end points for operators. Includes END-CALL, END-WRITE, END-IF, etc.
INSPECT. . .CONVERTING: similar to the INSPECT. . .REPLACING statement, but allows more than one character to be examined and converted.
New VALUE OF. . . items: the form number, print class, and file class can now be specified in the File Descriptor (FD). (Wang extension to COBOL.)
CALL BY CONTENT: differs from CALL BY REFERENCE in that variables remain local and unchanged when passed to another program. (Wang extension to COBOL.)
Choice of margin: the line length of a source line can be through columns 72 or 80.
New VALUE OF items: new items include PRINT-FORM, PRINT-CLASS, FILE-CLASS.
Figure 2: COBOL 85 Compiler Test Options
Item 74 compat Optimizing Symbolic Debug A YES NO YES B YES NO NO C IO NO NO D IO 1 NO E IO 2 NO F IO YES NO
Figure 3: COBOL 74 Compared to COBOL 85
Lightly loaded system:
Description COBOL 74 COBOL 85 Change (%) Elapsed time (secs) 77.9 75.5 (3.2) CPU time (secs) 25.9 25.9 -- System Pagein 23.0 19.0 (17.4) Program Pagein 39.0 41.0 +2.7 Disk I/O 645.3 539.1 (16.5) Heavily loaded system:
Description COBOL 74 COBOL 85 Change (%) Elapsed time (secs) 275.4 263.2 (4.4) CPU time (secs) 27.4 27.1 (1.0) System Pagein 15.6 12.7 (18.7) Program Pagein 28.0 27.5 (1.0) Disk I/O 646.0 539.9 (16.4)
Figure 4: Comparison of COBOL 85 Compile Options
Sample Test A Test B Test C Test D Test E Test F Elapsed time 273.1 265.4 266.6 265.8 263.2 267.6 Ratio to COBOL 74 .992 .964 .968 .965 .956 .972 Disk I/Os 540.0 540.0 540.1 540.0 539.9 529.0 Ratio to COBOL 74 .836 .836 .836 .836 .836 .819
Copyright © 1988 Dennis S. Barnes
Reprints of this article are permitted without notification
if the source of the information is clearly identified