IBM® COBOL for AIX®, V4.1.1 delivers various performance improvements in the COBOL runtime libraries that can help your applications run faster, enhanced I/O functionality, and productivity enhancements, which are described below.
COBOL for AIX, V4.1.1 provides:
- Runtime performance improvements for applications that use:
- Packed arithmetic and conversion to and from packed-decimal data
- Dynamic calls, external variables, external files, as well as module caching
- Multiple INSPECT statements
- File I/O performance improvements for the following file systems:
- NAT (Line Sequential)
- SdU (Sequential and Relative organizations only)
- STL (Sequential organization only)
- File I/O functional enhancements
- A file system (RAW) that enables you to directly access a QSAM file that you transferred (using z/OS FTP) from z/OS to AIX
- A WSCLEAR suboption to make it easier to port non-IBM COBOL files to COBOL for AIX, and to debug COBOL for AIX programs
Runtime performance improvements
Binary Coded Decimal library
The Binary Coded Decimal (BCD) library is enhanced, such that the performance
of packed arithmetic and conversion to and from packed-decimal data is improved.
- During the conversion of a numeric data item to and from a packed-decimal data item, negative zero is no longer converted to positive zero. Negative zero behaves the same as positive zero computationally, for example, it compares equal to positive zero. In most cases, negative zero will keep the negative sign when converted from zoned to packed, or vice versa. Negative 0 appears rarely in computation, an example will be adding -1 to -99 into a pic 9(2) field, the result is -0 because the high order 1 digit is truncated.
- A new run-time environment variable can be used to further improve the performance of packed arithmetic and conversion to and from packed-decimal data. When set to 1, COBOL_BCD_NOVALIDATE will not validate the form of the packed-decimal data item prior to conversion and arithmetic operations. This environment variable does not affect the 'IS NUMERIC' or 'IS NOT NUMERIC' class conditions that determine whether a data item is numeric or not numeric.
Other runtime performance improvements
The performance of applications, which use dynamic calls (CALL identifier), external variables, external files, as well as module caching, is improved.
The performance of applications that use the INSPECT statement multiple times is improved.
File system I/O performance improvements
I/O performance for NAT (line sequential), RSD file system, STL (sequential) file system, and SdU (sequential and relative) is improved.
File I/O functional enhancements
The following are the file I/O functional enhancements:
- RSD sequential files are no longer limited to fixed-length records.
- NAT files are compatible with non-IBM COBOL source by the record length being determined by one of:
- The requested read length (short reads)
- The location of the \n
(The only special character in NAT (and RSD) is the newline (\n), any other character, including NULL (0x00) is valid, and will not cause read/write errors.)NAT files and RSD files now support the ADVANCING phrase and the LINAGE clause.
- NAT, RSD, STL (sequential), SDU (sequential/relative), and RAW file systems now use file status 2, and the same format. For example, for NAT file system input and output requests, if data-name-8 is 6 bytes long, it contains the file status code. If data-name-8 is longer than 6 bytes, it also contains a message with further information:
02 exception-return-value PIC 9(6).
02 additional-info PIC X(100).
If you attempt to open a file using a different definition than the one with which the file was created, and use the file status code structure shown above, 39 is returned in exception-return-value, and a message that tells which keys you need in order to perform the open request is returned in additional-info.
- The runtime options FILEMODE(SMALL) or FILEMODE(LARGE) does not apply for COBOL for AIX, Version 4.1.1 programs. Any files created by COBOL for AIX, Version 4.1.1 programs default to large format. For compatibility with earlier versions of COBOL for AIX programs, FILEMODE(SMALL) is supported.
RAW file system
The RAW file system supports fixed, variable, and spanned records and enables you to directly access a QSAM file that you transferred (using z/OS FTP) from z/OS to AIX with the options “binary” and “quote site rdw”.
RAW files provide good performance. They give you the ability to port files easily between AIX, Windows-based systems, and the mainframe.
RAW files support all COBOL data types in the record.
The RAW file system is safe for use with threads. However, you must ensure that multiple threads do not access the level-01 records for the file at the same time. Multiple threads can perform operations on the same RAW file, but you must add pthread_cont_wait call or its equivalent to force all but one of the threads to wait for the file access to complete on the active thread.
You can obtain a RAW file from the mainframe using FTP with the options “binary” and “quote site rdw”. If the file contains EBCDIC character data, the AIX COBOL program should be compiled with –host to read or write the character data as EBCDIC. You can upload the same RAW file to the mainframe provided
the file already exists. If the file does not exist, then you must create it with the correct data set attributes.
The compiler option WSCLEAR is enhanced with a suboption so that you can initialize each byte of WORKING-STORAGE data to a specific value.
The new syntax for the compiler option:
| |___ (nnn) ____| |
nnn is an integer between 0 and 255.
NOWSCLEAR, WSCLEAR with no value or WSCLEAR(0) has the same behavior as the previous WSCLEAR option behavior. The WORKING-STORAGE data is initialized to hex zeroes.
If WSCLEAR(nnn) is specified, the byte value represented by nnn will be used to initialize all uninitialized WORKING-STORAGE data items.
The storage is initialized before any VALUE clauses are applied.