COBOL050.RELEASE_NOTES
Summary of Updates to VAX COBOL Version 5.0
May 1, 1992
After installation of VAX COBOL, the Release Notes are available in
SYS$HELP:COBOL050.RELEASE_NOTES
SYS$HELP:COBOL050_RELEASE_NOTES.LN03
SYS$HELP:COBOL050_RELEASE_NOTES.PS
The information in this document is subject to change without notice
and should not be construed as a commitment by Digital Equipment Cor-
poration. Digital Equipment Corporation assumes no responsibility for
any errors that may appear in this document.
The software described in this document is furnished under a license
and may be used or copied only in accordance with the terms of such
license.
No responsibility is assumed for the use or reliability of software
on equipment that is not supplied by Digital Equipment Corporation or
its affiliated companies.
Copyright Digital Equipment
Corporation. 1992. All rights reserved.
i
CONTENTS
1 Release Summary.......................................... 1
1.1 Compiler Version Numbers.............................. 1
1.2 Restrictions.......................................... 1
1.3 Restrictions Removed.................................. 3
1.4 Version-to-Version Incompatibilities.................. 4
1.5 Inter-Product Issues.................................. 5
1.6 Known Problems........................................ 6
1.7 Problems Corrected.................................... 6
1.8 Functional Enhancements............................... 11
Appendix A PERFORMANCE SUMMARY............................... 13
A.1 Overview............................................... 13
A.2 Background of This Release............................. 13
A.2.1 The VAX Architecture's Implementations and
Performance......................................... 14
A.2.2 History of VAX COBOL'S Extensive Use of
PACKED-DECIMAL Operations........................... 15
A.3 Performance Improvement Strategies..................... 16
A.3.1 The First Major Performance Release: Version 4.2A... 17
A.3.2 Version 4.4: More Performance Improvements.......... 18
A.3.3 Difficulties with Previous Coding Guidelines........ 20
A.3.4 Simplified New Guidelines........................... 21
A.3.5 Version 5.0: New Performance Improvements........... 22
A.3.6 Tools That Can Help You Decide Whether to Convert a
Program............................................. 22
TABLES
1 COBOL's Numeric Data Types............................ 15
iii
1 Release Summary
These release notes contain important information about changes in
VAX COBOL Version 5.0. It includes short descriptive summaries (as
applicable) of changes, restrictions, restrictions removed,
version-to-version incompatibilities, inter-product issues, known
problems, problems corrected, and functional enhancements for the
VAX COBOL compiler and the VAX COBOL Reformat Utility.
NOTE
These release notes should be made available to ALL users of VAX COBOL.
In addition to the standard features offered by VAX COBOL, COBOL V5.0
provides:
o Performance enhancements for certain COBOL arithmetic operations
on single chip VAX processors
o Intrinsic functions
o Multi-byte character support (requires VMS/Japanese)
o New CDD/Plus interface for DBMS Subschema access
o Initial value specification for the CDD/Plus Pointer data type
1.1 Compiler Version Numbers
The edit level number, which appears at the end of the version num-
ber, reflects the number of revisions made to the compiler. The ver-
sion number is printed at the top of each page of the source listing
generated by the compiler.
The edit level appearing to the left of each description was the level
number after that change was made. Thus, any compiler versions with
level numbers equal to or greater than the one given for a certain change
contain that change.
1.2 Restrictions
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 VAX COBOL V5.0 requires VMS V5.3 or later.
1
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 VAX COBOL Version V5.0 requires a new version of COBRTL
(the COBOL Run-Time Library). This RTL is automatically
installed when you install the compiler. You should also
install the new COBRTL on any processor on which you in-
tend to run your COBOL applications, even if you do not
plan to install the compiler on that processor, and you
should reinstall COBRTL after upgrading VMS. An option
to install only the COBRTL is included in the COBOL in-
stallation procedure. You do not need a COBOL license for
processors where you install only the COBRTL.
V5.0-27 In order to use the intrinsic functions, new with VAX COBOL
V5.0, the VAXCRTL.EXE must be present on your system.
V5.0-27 The functions MIN, MAX, ORD-MIN, and ORD-MAX do not sup-
port a non-native program collating sequence. If the pro-
gram has a PROGRAM COLLATING SEQUENCE clause that does
not refer to an ALPHABET clause specifying STANDARD-1,
STANDARD-2, NATIVE, or ASCII, a warning diagnostic is is-
sued at compile time that the default collating sequence
(NATIVE) will be used.
V5.0-27 Generic subscripting (with "ALL") is not yet supported
for the intrinsic functions.
V5.0-27 When a COBOL program with the IS INITIAL clause in a share-
able image is called, a "%COB-F-CANFAIL, CANCEL failed
on routine" message occurs and the CALL statement fails.
Similarly, if a COBOL program in a shareable image is ref-
erenced in a CANCEL program statement, the "%COB-F-CANFAIL,
CANCEL failed on routine" message occurs and the CANCEL
statement fails.
The particular method by which the COBOL run-time library
uses LIB$INITIALIZE prevents the INITIAL/CANCEL mecha-
nism from working in a shareable image. Therefore, avoid-
ing the use of the INITIAL clause in programs in share-
able images and avoiding references to programs in share-
able images in CANCEL statements will preclude the er-
ror.
V5.0-27 If the version number of a file specified in a literal
in the SELECT phrase contains leading zeros or is a log-
ical that translates to a searchlist, then the literal
string that is the value of RMS-FILENAME may contain ex-
traneous trailing characters.
2
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 If a source line contains more than one statement, DE-
BUG line numbers may be incorrect. This problem should
not occur, however, if each source line contains no more
than one statement.
V5.0-27 Programs longer than 65,535 source lines are not supported.
While the programs may compile, any compilation errors
that are detected in the source program past this limit
will result in misplaced diagnostic messages.
V5.0-27 COBOL programs not in a shareable image may not CALL pro-
grams within a shareable image using the CALL identifier
option. This is a permanent restriction. As a workaround,
you may use the CALL literal option, or CALL a program
within the shareable image, passing the name of the sub-
program which is to be CALLed. The program within the share-
able image may then CALL the sub-program using the CALL
identifier option.
V5.0-27 External files cannot be directly used in shareable im-
ages. This is a permanent restriction. As a workaround,
you may modify the PSECT attribute to NOSHR for the PSECTs
associated with the file (the PSECT names will be the FD-
name and record-name) in a linker options file at LINK
time. See the VAX COBOL User Manual and VAX/VMS Linker
Reference Manual for additional details.
___________________________________________________________________
1.3 Restrictions Removed
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 Formerly, because of limitations encountered during the
implementation of performance enhancements targeted to
single-chip processors, the /INSTRUCTION_SET qualifier
specifying the option NODECIMAL was not to be used when
the /TRUNC qualifier was present in the command line. The
two qualifers were incompatible: the /INST=NODECIMAL qual-
ifier superseded and negated the effect of /TRUNC when
they were used concurrently. This restriction has been
removed.
___________________________________________________________________
3
1.4 Version-to-Version Incompatibilities
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 The compiler no longer allows END-SEARCH to be specified
if the NEXT SENTENCE phrase is specified in a SEARCH state-
ment. This change is in compliance with a requirement set
by the ANSI COBOL standard.
V5.0-27 VAX COBOL V5.0 adds the new reserved word FUNCTION.
V5.0-27[1] VAX COBOL Version 4.4 significantly improved the run-time
performance for certain cases of arithmetic operations
when /INSTRUCTION_SET = NODECIMAL is selected and when
the application is run on single-chip processors. As a
result of these changes, there may in rare circumstances
be some differences in the results of invalid calcula-
tions involving the overflow or underflow of binary fields
when ON SIZE ERROR is not specified.[2]
V5.0-27[1] Potential differences in the least significant digit of
a computational result may occur between VAX COBOL Ver-
sion 5.0 or Version 4.4 using /INSTRUCTION_SET = NODEC-
IMAL and Version 4.3 using any option of the /INSTRUCTION_
SET qualifier.[2] VAX COBOL Version 4.4 and Version 5.0
performance enhancements for /INSTRUCTION_SET = NODEC-
IMAL have been, in part, achieved by the introduction of
a large binary data type to represent intermediate re-
sults inside a multi-operand (more than 3) arithmetic state-
ment. This new binary data type, octaword, can represent
up to 38 digits of information, compared to a possible
31 digits with packed decimal representation or 18 dig-
its with VAX COBOL intermediate representation. There-
fore the result of a computation may, because of the in-
creased precision of the octaword data type, yield more
accurate but different results for the least significant
digit.
___________________________________________________________________
[1]This item applies to V4.4-64 as well as V5.0-27.
[2]These differences may occur between (1) either Version 5.0 or Ver-
sion 4.4 and (2) versions earlier than 4.4. They are not differences
between Version 5.0 and Version 4.4.
4
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27[1] Other potential differences may occur in rare circumstances
between VAX COBOL Version 5.0 or Version 4.4 using
/INSTRUCTION_SET = NODECIMAL and Version 4.3 using any
option of the /INSTRUCTION_SET qualifier.[2] These
differences can occur when one or more floating point
operands (COMP-1,COMP-2) are mixed with one or more
non-floating point operands (COMP, DISPLAY, PACKED-DECIMAL)
in an arithmetic statement. When a COMP-1 operand is
present, you can expect identical results in the 6 most
significant digits of the final answer. When a COMP-2
operand is present (and no COMP-1 operands are present)
you can expect identical results in the 15 most significant
digits of the final answer. If both COMP-1 and COMP-2
operands are present then you can expect identical results
in the 6 most significant digits of the final answer.
Note that a floating point value is an approximation of
the true value; thus, operations on floating point val-
ues incur rounding error. In a complex calculation, the
rounding error propagates from one intermediate result
to the next, and may affect the final result. In addi-
tion, the order of evaluation of the parts of an expres-
sion as well as the size of the intermediate temporaries
affects the final result when rounding error is present.
The final result is, therefore, an approximation of the
true answer. To avoid this rounding error, use one of the
fixed point data types.
___________________________________________________________________
[1]This item applies to V4.4-64 as well as V5.0-27.
[2]These differences may occur between (1) either Version 5.0 or Ver-
sion 4.4 and (2) versions earlier than 4.4. They are not differences
between Version 5.0 and Version 4.4.
___________________________________________________________________
1.5 Inter-Product Issues
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 The DECwindows Compiler Interface (DWCI) functionality
is no longer included in the VAX COBOL kit.
V5.0-27 To fully use the support for the Program Design Facil-
ity (PDF) via the VAX COBOL /DESIGN command line qual-
ifier, the VAX Language-Sensitive Editor V3.0 or later
and the VAX Source Code Analyzer V2.0 or later are re-
quired.
5
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 To use the analysis data files produced by the VAX COBOL
V5.0 compiler via the /ANALYSIS_DATA qualifier, the VAX
Source Code Analyzer V2.0 or later is required.
V5.0-27 The VAX Language-Sensitive Editor (LSE) support for the
VAX COBOL intrinsic functions in Version V5.0 requires
LSE Version 4.0 or later.
V5.0-27 To fully utilize the VAX CDD/Plus support in VAX COBOL
Version V5.0, CDD/Plus Version 4.0 or later is required.
V5.0-27 VAX COBOL Version V5.0 requires VAX DBMS Version 4.0 or
later.
V5.0-27 VAX COBOL V4.0 and subsequent versions provide new LSE
template updates for COBOL. If you use LSE and want the
LSE environment files updated for VAX COBOL, then you should
select the appropriate option during the installation to
install the new templates.
___________________________________________________________________
1.6 Known Problems
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 The debugger may not point to the correct line number when
stepping through a program with a REPLACE statement nested
in a COPY file.
___________________________________________________________________
1.7 Problems Corrected
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 Garbled text no longer appears in diagnostic messages from
the CDD/Plus dictionary.
V5.0-27 An ADD GIVING statement with very large packed decimal
operands no longer gets a reserved operand fault at run
time when /STANDARD=V3 is used.
V5.0-27 The compiler now correctly compiles PERFORM VARYING state-
ments with multiple complex conditional expressions. Pre-
viously, in rare instances, the compiler would inadver-
tently flag such constructs with a fatal diagnostic.
6
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 SCA information is now generated for references to el-
ements of group data items.
V5.0-27 A problem causing incorrect run-time behavior for some
programs containing a division operation has been cor-
rected. The problem occurred when the divisor was zero
and there was an ON SIZE ERROR and/or NOT ON SIZE ERROR
phrase.
V5.0-27 The behavior of an ACCEPT statement with EDITING and DE-
FAULT IS CURRENT VALUE is now correct. When the input buffer
is modified, the value represented in the modified buffer,
as opposed to the original value, is now the resultant
value.
V5.0-27 The compiler no longer aborts with an internal logic er-
ror in certain circumstances when processing a complex
INITIALIZE statement with many literal subscripts.
V5.0-27 Information about the last lines of a COBOL program, when
those lines are copied into the source file with a COPY
REPLACING statement, are now correctly reported to the
VAX DEBUGGER.
V5.0-27 In the REPORT SECTION, the compiler no longer semanti-
cally checks the field that is used to output the value
of the SUM clause as if it were the field that is the ob-
ject of the SUM clause.
V5.0-27 A problem that occasionally caused an access violation
at run time during the execution of an INSPECT statement
with TALLYING and REPLACING clauses and subscripted operands
has been corrected.
V5.0-27 Information about the first source line in a COBOL pro-
gram is now correctly reported to the VAX DEBUGGER.
V5.0-27 A problem causing incorrect design information to be gen-
erated for the /DESIGN = COMMENTS qualifier has been cor-
rected. This problem was manifested when the REPORT IN-
TERNALS command was issued from LSE.
V5.0-27 A problem that occasionally caused an access violation
when the /ANALYSIS_DATA qualifier was specified has been
corrected.
7
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 A problem causing the compiler to access virtual memory
that it should not have access to has been corrected.
V5.0-27 When floating point data items (COMP-1, COMP-2) with edit
strings are copied from the CDD, the edit strings are now
correctly ignored.
V5.0-27 A problem causing the RMS-CURRENT special registers oc-
casionally not to be properly updated after an exception
condition has been corrected.
V5.0-27 A problem that in rare circumstances caused an ADD state-
ment with multiple receiving items to produce an incor-
rect result has been corrected.
V5.0-27 Very infrequently, exponentiation involving two quadword
operands produced an incorrect result when the /INSTRUCTION_
SET = NODECIMAL qualifier was specified. This problem has
been corrected.
V5.0-27 In certain instances involving large intermediate operands,
a comparison or addition operation produced an incorrect
result when the /INSTRUCTION_SET = NODECIMAL qualifer was
specified. This problem has been corrected.
V5.0-27 An access violation no longer occurs at run time when a
numeric leading signed separate data item defined in the
linkage section is involved in an alphanumeric compar-
ison or move.
V5.0-27 An internal logic error no longer occurs in processing
an abbreviated relation condition. Previously, in rare
instances, an invalid virtual memory address was computed,
triggering the subsequent internal logic error.
V5.0-27 The flow of control for statements that have (1) both an
AT END and a NOT AT END phrase or (2) both an INVALID KEY
and a NOT INVALID KEY phrase, and that also have an ap-
plicable USE procedure, is now correct. Previously, when
a condition other than an AT END or INVALID KEY occurred,
the program incorrectly executed the NOT AT END or NOT
INVALID KEY phrase following execution of the USE pro-
cedure. Control now correctly flows to the statement fol-
lowing the statement with the AT END or INVALID KEY phrase;
and the NOT AT END or NOT INVALID KEY phrase is not ex-
ecuted.
8
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 An internal logic error no longer occurs in processing
an invalid REDEFINES clause with the /ANALYSIS_DATA qual-
ifier.
V5.0-27 Record locking behavior is now correct for REWRITE and
DELETE statements that dynamically reference consecutive
records with duplicate primary keys.
V5.0-27 A diagnostic is now properly reported to LSE when the first
token in the program is not IDENTIFICATION.
V5.0-27 An internal logic error no longer occurs in processing
an INITIALIZE statement with multiple subscripted sub-
jects defined in the LINKAGE SECTION.
V5.0-27 An access violation formerly occurred in rare circumstances
in processing a DISPLAY "literal" statement; this prob-
lem has been corrected.
V5.0-27 A more correct diagnostic is now issued when a condition
name is referenced in the context in which a numeric ex-
pression is expected.
V5.0-27 A problem with the formatting of floating point values
referenced in DISPLAY statements has been corrected.
V5.0-27 Previously, exponentiating a scaled quadword by a scaled
quadword exponent, when the input values fit within the
low longword of each input quadword, could result in a
wrong answer on rare occasions. This problem has been cor-
rected.
V5.0-27 Previously, adding a COMP value to multiple numeric dis-
play destinations (ADD A (COMP) to B (DISPLAY), C(DISPLAY),
for example) produced incorrect results if the value in
the COMP field was larger than its picture clause. (This
problem did not occur if ROUNDED or ON SIZE ERROR clauses
were specified.) This problem has been corrected.
V5.0-27 The compiler no longer executes a specified ON SIZE ER-
ROR clause when no size error condition exists, when the
/INSTRUCTION_SET = NODECIMAL qualifier is specified and
certain arithmetic statements involve a conversion of an
unsigned numeric item to a binary longword destination.
9
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 An incorrect answer was formerly generated in rare cir-
cumstances when an arithmetic expression required a con-
version from the numeric display data type to binary word
or longword with scaling. This problem has been corrected.
V5.0-27 The compiler no longer loops infinitely when the
/INSTRUCTION_SET = GENERIC qualifier is specified. This
problem occurred previously in certain infrequent
circumstances.
V5.0-27 The compiler no longer creates an invalid picture clause
when a CDD/Plus field that is based on another field that
specifies a scale factor is referenced in a COPY FROM DIC-
TIONARY statement. Now, a diagnostic is issued, the scale
factor is ignored, and the correct picture clause is cre-
ated.
V5.0-27 An illegal string class error issued from CDD/Plus no longer
occurs when a DB subschema copy from dictionary (DB state-
ment) is processed using the /MAP qualifier. Previously,
the compiler in some circumstances failed to properly ini-
tialize a string descriptor that was being passed to CDD/Plus.
V5.0-27 Comment and/or blank lines after a COPY statement fol-
lowing a REPLACE statement are no longer missing from the
listing file.
V5.0-27 Occasional internal logic errors generated by the com-
piler when the /INSTRUCTION_SET = NODECIMAL qualifier was
specified and certain types of arithmetic expressions were
included in the source have been corrected.
V5.0-27 Duplicate entries in the cross reference listing when the
/MAP qualifier is specified, and/or inadvertent ambigu-
ous reference errors no longer occur when a contained pro-
gram has identically named symbols as the program within
which it is contained.
V5.0-27 The compiler no longer access-violates while compiling
very large programs with many COPY statements; this prob-
lem was caused by an invalid internal memory reference.
V5.0-27 Occasional incorrect comparisons no longer occur when an
internal intermediate data type is compared to 0.
V5.0-27 An incorrect diagnostic line number is no longer occa-
sionally generated for a line within a COPY statement fol-
lowing a REPLACE statement.
10
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 Previously in certain rare circumstances, an incorrect
result was obtained when all of the following conditions
prevailed: (1) the sources of a computation were COMP-
3; (2) there were multiple destinations, one of them be-
ing a COMP data item; (3) ROUNDED was specified; and (4)
the /INSTRUCTION_SET = NODECIMAL qualifier was specified.
This problem has been corrected.
V5.0-27 An occasional reserved operand fault that occurred dur-
ing run-time exponentiation involving COMP-3 items has
been corrected.
V5.0-27 Previously at run time, certain data conversion opera-
tions from COMP-2 to the COBOL intermediate data type could
in rare circumstances produce an incorrect result. This
problem has been corrected.
V5.0-27 A problem that occurred during the processing of an AC-
CEPT PROTECTED EDITING statement has been corrected. This
problem occurred when a ^A was issued to enter insert mode
and a blank instead of the character entered was accepted.
V5.0-27 A problem that occasionally caused an incorrect cursor
position during an ACCEPT PROTECTED NO BLANK EDITING state-
ment has been corrected.
___________________________________________________________________
1.8 Functional Enhancements
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 VAX COBOL V5.0 adds intrinsic functions, as specified in
the Intrinsic Function Module Addendum to the 1985 ANSI
Standard.
V5.0-27 Performance enhancements for certain COBOL arithmetic op-
erations on single chip VAX processors are provided, par-
ticularly run-time performance enhancements for COMP-3
(packed decimal data items) arithmetic operations exe-
cuting on single chip VAX processors when compiled with
the /INST=NODECIMAL qualifier.
V5.0-27 Multi-byte character support (which requires VMS/Japanese)
is provided as required for MIA V1 compliance.
11
___________________________________________________________________
Version_______Description__________________________________________
V5.0-27 There is a new CDD/Plus interface for DBMS Subschema ac-
cess, to reduce the compile time of DBMS applications.
V5.0-27 The compiler now supports the CDD/Plus POINTER data type
with the TO attribute, which allows specification of an
initial value for a POINTER data item.
V5.0-27 Within the COBOL050.C save set, there is now another save
set named COBRTL050.A, which contains the COBOL Run-Time
Library (COBRTL) image as well as the files needed to in-
stall it. This new save set may be useful to some ven-
dors of VAX COBOL applications, who can distribute it to
customers who need to install the COBRTL separately to
remedy COBRTL incompatibility problems. (See the VAX COBOL
Installation Guide.)
___________________________________________________________________
12
APPENDIX A
PERFORMANCE SUMMARY
Version 5.0 of the VAX COBOL compiler and the accompanying Run-Time
Library contain enhancements that will further improve run-time per-
formance.
This section defines the purpose of the performance improvements in
the release, reviews the historical background, and summarizes the evo-
lution of coding guidelines for best performance.
A.1 Overview
Version 5.0 offers significant performance improvement in arithmetic
operations with PACKED-DECIMAL (COMP-3) operands, as well as less sig-
nificant performance improvements with other operands. This is for COBOL
programs compiled with the /INSTRUCTION_SET = NODECIMAL_STRING qual-
ifier and executing on single-chip VAX processors. The performance im-
provements in this release thus complement the performance improve-
ments made in previous releases.
NOTE
Dramatic performance improvements in Version 5.0 have been achieved
for various single arithmetic operations. Improvements in the per-
formance of whole applications cannot be expected to be so dra-
matic, and will vary widely.
A.2 Background of This Release
Further performance enhancements in the compiler are provided because
a small but significant minority of customers have experienced per-
formance degradation when running VAX COBOL applications on single-
chip VAX processors.
Performance Layers
There are five general areas (or layers) that affect CPU performance
on single-chip VAXes:
o COBOL source code (data types used)
o Generated instructions (by the COBOL compiler)
o Run-Time Library (COBOL program run-time support)
o Emulator (handles "traps" for packed-decimal instructions)
o VAX hardware
Performance Summary 13
All these performance layers have been the object of Digital's efforts,
described below, to improve the performance of compute-intensive ap-
plications. The lowest performance layer, the VAX hardware, is described
first, in Section A.2.1.
A.2.1 The VAX Architecture's Implementations and Performance
The VAX architecture specifies a uniform instruction environment that
allows images to be run on any implementation of the architecture with-
out recompilation or relinking. As with many vendors, it is common to
implement different hardware models using different techniques, specif-
ically with different mixtures of hardware, firmware, and software.
All VAX systems support all VAX instructions - but not by identical
means. Some VAX processors execute certain instructions in hardware,
others execute them in software. In particular, as the VAX architec-
ture has been implemented on smaller, faster chips, some packed-decimal
instructions that were formerly implemented in hardware (through mi-
crocode) have now been implemented in software (through emulation).
On a single-chip VAX, a "trap" is taken on these packed-decimal in-
structions, which are then executed in the software. This change, in
fact, saved about half of the memory required for such instructions
executed in the hardware through microcode, and thus made it possi-
ble to use smaller, faster chips. If you are not sure whether your VAX
emulates packed-decimal instructions, you can find out by entering the
following DCL command:
$ WRITE SYS$OUTPUT F$GETSYI ("DECIMAL_EMULATED")
Performance Benefits Overall
Supporting packed-decimal instructions in software has allowed over-
all system performance to be greatly improved by reducing chip size
and complexity, thereby reducing overall system size and expense. For
example, the VAX 6000-560 CPU incorporates over 70 times the process-
ing power of the VAX 11/780 in a smaller cabinet than was required for
the 11/780.
Performance Slowdowns for a Minority of Applications
Although the overall system performance of single-chip processors is
improved, applications that make heavy use of the packed-decimal in-
structions, now emulated in the software, may run more slowly than ex-
pected. When the architectural decision was made to support packed-
decimal instructions in software, it was believed that only a small
number of applications would be adversely affected. Digital expected
that most COBOL applications would be primarily sensitive to I/O per-
formance, rather than raw CPU speed. Furthermore, to whatever extent
COBOL applications are sensitive to CPU speed, they are primarily sen-
sitive to BINARY performance rather than PACKED-DECIMAL performance,
since even programs doing computation in PACKED-DECIMAL normally use
BINARY for program control structures, indexes, pointers, and so forth.
Therefore, the decision was made to accept reduced performance for a
small class of applications in order to achieve improved performance
for the overall system.
14 Performance Summary
Experience has shown that only a small minority of applications pay
a performance penalty. As expected, most COBOL applications appear to
be primarily sensitive to either I/O performance or BINARY performance.
The exceptions are primarily compute-intensive, "number-crunching" ap-
plications, which typically execute in batch processing mode, and which
perform extensive computations in PACKED-DECIMAL, such as the process-
ing of a monthly application cycle computing earnings, taxes, fore-
casts, and so on. Experience has also shown that, although such compute-
intensive applications may be a small minority at a site, these ap-
plications can be very important. If, for example, a customer expects
that the processing of a monthly application cycle can be run overnight
and, instead, it computes on into the daytime, such a performance penalty
is undesirable.
A.2.2 History of VAX COBOL'S Extensive Use of PACKED-DECIMAL
Operations
When VAX COBOL Version 1.0 was being designed, the wide use of the PACKED-
DECIMAL data type by the compiler was clearly advantageous. Table 1
and the following text explain the reasons.
___________________________________________________________________
Table_1:__COBOL's_Numeric_Data_Types_______________________________
Maximum Decimal Dig-
Data_Type__________Description_____________________its_____________
SCALED INTEGERS:
COMP Binary 18
COMP-3 2 Packed digits per byte 18
DISPLAY 1 ASCII digit per byte 18
FLOATING POINT:
COMP-1 Single-precision floating About 7
(8-bit exponent, 24-bit mantissa)
COMP-2 Double-precision floating About 16
(8-bit exponent, 56-bit mantissa)
___________________________________________________________________
In the following example, the decimal number 65536 has the hexadec-
imal representation shown in each of the scaled-integer data types:
COMP: 65536 = 00010000
COMP-3: 65536 = 65 53 6C
DISPLAY: 65536 = 36 35 35 33 46
Note that in COBOL, all of the scaled-integer data types can store up
to 18 decimal digits. However, the VAX integer data type longword (used
for instructions such as ADDL, meaning add longword) can hold only 9
decimal digits. The VAX integer data type quadword can hold more, but
quadword uses the less convenient instructions EMUL and EDIV (extended
multiply and divide). Therefore, none of the VAX integer data types
Performance Summary 15
were ideally fitted to the VAX COBOL integer data types, which can hold
up to 18 decimal digits. The VAX data type string, which can hold up
to 31 decimal digits, is unsuitable because there are no string arith-
metic instructions (only CVT, meaning convert).
The VAX data type packed-decimal, on the other hand, can hold up to
31 decimal digits, and is supported by the major arithmetic instruc-
tions (ADDP, SUBP, MULP, and DIVP), as well as the powerful ASHP (arith-
metic shift) instruction. The VAX data type packed-decimal was thus
a natural fit for many COBOL operations, and so VAX COBOL Version 1.0
used the PACKED-DECIMAL data type for many situations, as follows:
o PACKED-DECIMAL operands
o DISPLAY operands used in arithmetic operations
o Very large integer operands
o Situations in which scaling differed between the operands and the
result
o ROUNDED operations (because rounding is relative to decimal dig-
its)
o ON SIZE ERROR operations (because size checking is relative to a
PICTURE clause specifying decimal digits)
o Intermediate operations (which handle large intermediate values re-
sulting, for example, from COMPUTE statements)
Because packed-decimal operations were performed by microcode, in the
hardware, there was no performance degradation at the time of VAX COBOL
Version 1.0. Much later, the situation changed, with the emulation in
software of packed-decimal instructions for single-chip VAX proces-
sors.
A.3 Performance Improvement Strategies
Digital has employed the following four strategies to improve the per-
formance of compute-intensive applications:
1. Modify the compiler to use BINARY or PACKED-DECIMAL COBRTL routines
or in-line BINARY or PACKED-DECIMAL code to avoid or minimize the
generation of emulated instructions wherever possible.
2. Improve the performance of the instruction emulator itself.
3. Develop guidelines for customers on how to get the best performance.
4. Bring specific customer applications into Digital and study them
to better understand which real-life application characteristics
produce which performance effects.
COBOL V4.2A, which introduced the /INSTRUCTION_SET qualifier, is an
example of the first strategy. (See Section A.3.1.)
16 Performance Summary
VMS V5.2 is an example of the second strategy. The VAXEMUL.EXE instruc-
tion emulator included in VMS V5.2 provided some applications with a
20% improvement for multiplication and division, through significantly
faster MULP (multiply packed operations) and DIVP (divide packed op-
erations).
The third and fourth strategies have resulted in an evolution of guide-
lines to customers, described in Section A.3.3, Section A.3.4, and Sec-
tion A.3.6.
A.3.1 The First Major Performance Release: Version 4.2A
The first performance release for single-chip VAX processors was VAX COBOL
Version 4.2A. That version introduced the /INSTRUCTION_SET qualifier,
which optimizes the execution of a program for the machine being used.
The qualifier has three options:
/INSTRUCTION_SET=DECIMAL_STRING
/INSTRUCTION_SET=NODECIMAL_STRING
/INSTRUCTION_SET=GENERIC
The DECIMAL_STRING option is for processors that do not emulate packed-
decimal. NODECIMAL_STRING is for processors that do emulate packed-
decimal. GENERIC is a "middle" option to use when you do not know what
machines will be used.
Note: When you choose which option of the qualifier to use, you should
consider which processor type will be used most frequently with your
application. If it is unknown which processor type will be used, you
can do one of two things:
o Pick GENERIC. This should be satisfactory for the majority of ap-
plications.
o Or, you can compile (and link) the application twice, with DECI-
MAL_STRING and NODECIMAL_STRING, and keep both versions available.
At run time, a DCL command file can pick which version to run, us-
ing commands such as this:
$ if f$getsyi ("decimal_emulated")
$ then
$ RUN MY_APPL.NODEC
$ else
$ RUN MY_APPL.DEC
$ endif
Obviously, the latter solution requires more effort and more disk space
than the former, so you may wish to use the latter solution only for
your most compute-intensive and time-critical applications.
The option NODECIMAL_STRING causes the compiler to use new COBRTL rou-
tines for various PACKED-DECIMAL or DISPLAY operations. These new rou-
tines avoid emulated instructions. For example, the RTL routine COB$MULN
multiplies numeric DISPLAY text strings without software emulation.
By contrast, with the option DECIMAL_STRING (or in Version 4.1), such
Performance Summary 17
a multiplication would be done with the following three VAX instruc-
tions, all of which are emulated in the software on single-chip pro-
cessors:
CVTTP convert text to PACKED
MULP multiply PACKED
CVTPT convert PACKED to text
Version 4.2A also included the following performance improvements:
o Replaced certain character compares with integer compares
o Reduced the frequency of use of the COBOL intermediate type (which
heavily uses PACKED-DECIMAL instructions)
o Added certain "peephole" optimizations to avoid PACKED-DECIMAL in-
structions
The primary benefit of Version 4.2A was to "number-crunching" programs
with many COMP-3 or DISPLAY operands. BINARY (COMP) operations were
not an area of concentration. The reason was partly that BINARY op-
erations are already very fast - if the items fit in 32 bits, which
hold only 9 decimal digits. COBOL, of course, allows 18 decimal dig-
its, in each of its scaled-integer data types, as well as PACKED-DECIMAL.
Thus, large BINARY values still used PACKED-DECIMAL operations. Some
customers were still affected. Version 4.4 remedied this situation.
A.3.2 Version 4.4: More Performance Improvements
Version 4.4 improved performance by avoiding emulation of instructions
in software in the following four areas when /INSTRUCTION_SET=NODECIMAL
was used:
o New Octaword data type and RTL routines for large BINARY values
o ROUNDED operations on BINARY variables
o ON SIZE ERROR operations on BINARY variables
o Intermediate operations, benefiting COMPUTE statements, including
exponentiation
Descriptions of these four areas of improvement follow.
o Octaword
Operations on 18-digit binary items sometimes produce very large
intermediate values. An 18-digit binary item is stored as a quad-
word (64 bits), but the multiplication of two 64-bit numbers gives
a 128-bit result. The Octaword internal binary data type, added in
Version 4.4, holds 128 bits. New run-time library routines process
Octaword operations.
The multiplication of scaled quadwords is handled very differently,
starting with Version 4.4. In Version 4.3, MULP (multiply packed)
and RTL routines containing many emulated instructions were required,
18 Performance Summary
as follows:
COB$CVTQP Convert quadword to packed
MULP Multiply packed
COB$CVTPQ Convert packed to quadword
Since Version 4.4, by contrast, the multiplication of scaled quad-
words has been handled by Octaword RTL routines that contain no em-
ulated instructions at all:
EXTV Extend quadword to octaword
COB$MULO Multiply octaword
COB$CVTOQ Convert octaword to quadword
As a result, large binary operations are much faster. They have been
measured, in fact, at as much as 10 times faster (that is, requir-
ing 90% less CPU time). They are significantly faster (for exam-
ple) on a single-chip VAX 6000-410 than on a VAX 8810.
o ROUNDED Operations
Before Version 4.4, BINARY operands that were rounded were converted
to PACKED-DECIMAL, rounded, and converted back. Because rounding
is a decimal-oriented operation, this was a natural method. Ver-
sion 4.4 did not convert BINARY operands to PACKED-DECIMAL for ROUNDED
operations, thus avoiding emulation.
o ON SIZE ERROR Operations
ON SIZE ERROR checking was also naturally done in PACKED-DECIMAL,
because ON SIZE ERROR checking is relative to the decimal digits
in the PICTURE clause. In Version 4.4, BINARY operands were no longer
converted to PACKED-DECIMAL, avoiding emulation.
o Intermediate Operations
In Version 4.4, operations with the COBOL intermediate internal data
type, which holds large temporary values, avoided emulation. As a
result, COMPUTE statements for all operand types benefited, includ-
ing COMP, PACKED-DECIMAL, and DISPLAY.
A notably time-consuming COMPUTE operation is exponentiation, which
even on a VAX 8810 is usually much slower than other COMPUTE op-
erations. Worse, on a VAX 6000-410, exponentiation was as much as
10 times slower than on an 8810, prior to Version 4.4. With Ver-
Performance Summary 19
sion 4.4 and with the qualifier /INSTRUCTION_SET=NODECIMAL, expo-
nentiation was improved in two important ways:
- For small values, a specialized, very fast algorithm made the
operation typically as much as 50 to 100 times faster than un-
der Version 4.3.
- For large values a faster intermediate avoided emulation and worked
in many cases 3 to 5 times faster than before.
Note, however, that while these improvements were dramatic, they were
measured for single low-level arithmetic operations (exponentiation,
addition, subtraction, multiplication, and division), and the effect
on real-life applications as a whole was difficult to judge. Certainly
most applications cannot be expected to accelerate so dramatically,
and the performance varies from program to program.
Note that for simple arithmetic operations not involving large BINARY
values, ROUNDED, ON SIZE ERROR, or COMPUTE, and for simple PACKED-DECIMAL
and DISPLAY operations, Version 4.4 has usually performed about the
same as Version 4.3.
For example, experience with real-life applications during field test-
ing of COBOL Version 4.4 showed that some applications are not sig-
nificantly helped by COBOL Version 4.4. Of about 20 applications for
which comparisons could be made, about half improved by under 20% (that
is, consumed 20% less CPU time). These applications are believed ei-
ther to be I/O intensive, so that Version 4.4's CPU improvements were
unnecessary, or to be using data types other than BINARY.
On the other hand, about a third of the tested applications reduced
CPU consumption by 40% or more. One application reduced CPU consump-
tion by over 90%, but this is not considered typical.
Finally, four real applications were partially or wholly converted to
use BINARY (COMP) variables instead of COMP-3 and DISPLAY. All four
ran remarkably faster under Version 4.4 than under Version 4.3, with
CPU consumption reduced between 40-65%.
A.3.3 Difficulties with Previous Coding Guidelines
Previously, six coding guidelines to improve VAX COBOL performance were
developed and presented to customers at DECUS and other forums. It was
recommended that, where possible, customers do the following:
A. Specify USAGE BINARY (COMP)
B. Use the smallest sized item that will hold your result
C. Avoid COMPUTE (use ADD, SUBTRACT, MULTIPLY, DIVIDE)
D. Avoid ROUNDED
E. Avoid ON SIZE ERROR
F. Avoid exponentiation
20 Performance Summary
Experience with actual customer applications has shown that these guide-
lines were sometimes difficult to follow in practice. For example, one
firm converted a large application to BINARY (COMP), but did not avoid
ROUNDED, and the performance of the application actually worsened. This
firm was kind enough to allow Digital to study the application in de-
tail. The study indicated that where the original generated code used
packed-decimal (emulated) instructions, the generated code from the
modified application converted binary operations to packed-decimal,
performed the operation in packed-decimal, and converted the result
back to binary. As a result, the application was slower, because of
the time-consuming conversions. The compiler performed these conver-
sions because the internal rounding algorithm expected packed-decimal
operands.
In general, it was shown that versions of VAX COBOL prior to Version
4.4 were likely to convert operands to packed-decimal for purposes,
typically, of precision (packed-decimal instructions can handle up to
31 digits) or for convenience when doing rounding and size checking.
The violation of any of the guidelines B through F was likely to re-
sult in these conversions, and hence in slower performance.
A.3.4 Simplified New Guidelines
As a result of customers' experiences with the six guidelines, Dig-
ital decided to create a version of VAX COBOL that would have vastly
simpler coding guidelines. The goal of COBOL Version 4.4 was to sim-
plify the coding guidelines for CPU performance on single-chip VAXes
to a single one:
A. Specify USAGE BINARY (COMP)
Although cases B through F may still require additional processing (for
example, multiplying a 15 digit number requires more time than mul-
tiplying a 9 digit number), the intent of Version 4.4 was that none
of cases B through F should result in the use of emulated instructions
for BINARY operands, and therefore these cases should have all run sub-
stantially faster than in previous versions.
In short, the thrust of Version 4.4 was to improve the performance of
COBOL programs that use BINARY (COMP) operands by avoiding the use of
emulated instructions.
NOTE
Version 4.4 did provide limited performance improvement for some
programs that use DISPLAY or PACKED-DECIMAL (COMP-3). In general,
however, the more BINARY (COMP) variables and operations the pro-
gram contained, the more it could benefit from the performance
improvements in Version 4.4. Performance improvements for pro-
grams that use DISPLAY or PACKED-DECIMAL (COMP-3) have been tar-
geted in Version 5.0.
Performance Summary 21
COBOL Data Types and Single-Chip VAX Instruction Modes
COBOL data items have their type declared by a USAGE clause. These US-
AGE clauses and the instruction modes usually employed on single-chip
VAX processors are summarized below:
___________________________________________________________________
Single-Chip VAX Usual
USAGE__________________DATATYPE______________Operation_Mode________
COMP, BINARY Binary Hardware (faster)
COMP-1 Floating Hardware (faster)
COMP-2 D-Float Hardware (faster)
COMP-3, PACKED-DECIMAL Packed-decimal Software (slower)
DISPLAY Text, converted to Software (slower)
Packed-decimal
___________________________________________________________________
Precision Not Reduced by Conversion to BINARY
Converting to BINARY (COMP) should not be confused with converting to
floating point (COMP-1 or COMP-2), which are approximations using a
scientific notation relative to powers of two. A COMP-1 operand gives
approximately 7 decimal digits of precision, a COMP-2 approximately
16; either could often represent a value less precisely than an 18-
digit PACKED-DECIMAL operand.
On the other hand, the semantics of COMP, COMP-3, and DISPLAY operands
are the same: each can be scaled, signed, and can hold up to 18 dec-
imal digits. Therefore, converting existing programs from COMP-3, PACKED-
DECIMAL, or DISPLAY to COMP (BINARY) will yield results that are no
less accurate or precise. The only effect on operands is the method
of storage; and the primary effect on operations is improved perfor-
mance. (However, see the table on Restrictions for information on po-
tentially different results between the qualifiers /INSTRUCTION_SET=DECIMAL
and /INSTRUCTION_SET=NODECIMAL when one or more floating-point operands
are mixed with non-floating-point operands.)
A.3.5 Version 5.0: New Performance Improvements
Version 5.0 improves performance further by avoiding emulation of in-
structions in software for PACKED-DECIMAL (COMP-3) operands when
/INSTRUCTION_SET=NODECIMAL is used. These improvements encompass a broad
range of PACKED-DECIMAL (COMP-3) operations. In addition, there are
some further improvements for BINARY (COMP) and DISPLAY operations,
though the majority of such improvements were added in V4.4 and V4.2A,
respectively.
22 Performance Summary
Note, however, as with previous performance releases, that while these
improvements are dramatic, they are measured for single low-level arith-
metic operations (exponentiation, addition, subtraction, multiplica-
tion, and division), and the effect on real-life applications as a whole
is difficult to predict.
NOTE
Version 5.0 does provide marked performance improvement for some
programs that use PACKED-DECIMAL (COMP-3). However, it is still
generally desirable to use BINARY (COMP) variables and operations
to maximize performance.
A.3.6 Tools That Can Help You Decide Whether to Convert a Program
Digital does not recommend a massive conversion of all source programs
to use BINARY operands. With V5.0, even more applications which use
non-BINARY operands will experience a performance boost. In addition,
most existing COBOL programs perform very well on single-chip VAX pro-
cessors anyway; and conversions of old programs can be expensive. Dig-
ital recommends using its COHESION tools to help decide which programs
would run significantly faster if converted, and to discover program
interdependencies, as follows:
VAX PCA
The VAX Performance and Coverage Analyzer (PCA) can target specific
areas of programs that require unusual amounts of CPU time. If 80% of
the processing time is used by 20% of the COBOL routines, you may ben-
efit from converting these routines to use BINARY.
VAX SCA and VAX LSE
The VAX Source Code Analyzer (SCA) can help discover program inter-
dependencies as you contemplate changes. For example, if it is pro-
posed that an item declared COMP-3 be changed, SCA can quickly and eas-
ily find all the references to that item.
If SCA is used in conjunction with the VAX Language-Sensitive Editor
(LSE), LSE can bring up windows on a workstation with each of the ref-
erences.
VAX CDD/Repository
The Common Data Dictionary can record data definitions and dependency
information, which can then be maintained from one centralized loca-
tion.
VAX SCAN
VAX SCAN is a text-processing language that recognizes and operates
on text patterns. SCAN can be used to create programs that analyze or
modify COBOL source code, for example, changing COMP-3 declarations
to COMP.
Performance Summary 23