Compaq COBOL V2.6 Release Notes - May 28, 1999 NOTE The text version of this document was created to be displayed or printed with a fixed-spaced font. Make sure to switch to a fixed- spaced font such as Courier 10 for proper display or printing of the tables within the text version of this document. File location: OpenVMS Alpha: SYS$HELP:COBOL026_RELEASE_NOTES.PS OpenVMS Alpha: SYS$HELP:COBOL026.RELEASE_NOTES Compaq Tru64 UNIX: /usr/lib/cmplrs/cobol/relnotes Windows NT Alpha: .\DEC\COBOL\V26\docs\Release_Notes.txt,.ps,.pdf (c) Digital Equipment Corporation. 1993, 1999. All Rights Reserved. Compaq COBOL V2.6 Release Notes i CONTENTS 1 Release Summary.......................................... 1 1.1 Windows NT Alpha Additional Information............... 2 1.2 Version Numbers....................................... 4 1.3 Problems Corrected Since DIGITAL COBOL V2.5........... 5 1.4 Restrictions and Known Problems....................... 9 2 Recent Enhancements...................................... 18 2.1 CIT3 18-Digit Intermediates........................... 18 2.2 31-Digit User Items................................... 19 2.3 CIT4 32-Digit Intermediates........................... 20 2.4 Additional COPY Directories (/INCLUDE)................ 22 2.5 Y2K (Year 2000) Summary of Support.................... 22 2.6 Y2K Intrinsic Functions............................... 24 2.7 Stop with Status...................................... 25 2.8 Automatic DISPLAY WITH CONVERSION..................... 26 2.9 [OpenVMS] Initialization Using Literals from CDD...... 26 2.10 [OpenVMS] USAGE IS POINTER-64........................ 26 2.11 [OpenVMS] SYS$CURRENCY Support....................... 26 2.12 [Windows NT] Debugging Improvements.................. 27 2.13 [Windows NT] Visual Basic Examples Calling COBOL DLL. 28 2.14 [Windows NT] ORGANIZATION INDEXED.................... 28 2.15 [Windows NT] ACCEPT/DISPLAY Screen Handling.......... 29 2.16 [Windows NT] Interactive Compiler Driver (ICD)....... 30 3 Run-Time Library Notes................................... 31 4 Debugger Notes........................................... 31 4.1 Debugger Notes for OpenVMS Alpha...................... 31 4.1.1 Restrictions....................................... 31 4.2 Debugger Notes for Tru64 UNIX......................... 31 4.2.1 Features........................................... 32 4.2.2 Restrictions....................................... 32 4.3 Debugger Notes for Windows NT Alpha................... 34 5 Documentation Notes...................................... 36 5.1 Documentation Changes and Updates..................... 36 5.1.1 Intrinsic Function Documentation Updates........... 37 5.1.2 Example - cobfunc, cobcall, cobcancel.............. 43 5.2 [Windows NT] Adobe Acrobat Reader..................... 47 5.3 Summary of the Compaq COBOL Documentation Set......... 49 5.4 Feedback on Our Documentation......................... 50 6 Troubleshooting Tips..................................... 51 7 Compaq COBOL Compatibility Matrix........................ 58 8 Providing Product Feedback............................... 60 iii 1 Release Summary These release notes contain important information about Compaq COBOL V2.6 including a short descriptive summary of features and sections on problems corrected, restrictions and known problems, recent enhance- ments, debugger notes, documentation notes, troubleshooting tips, and a Compaq COBOL compatibility matrix. This release includes an updated compiler, an updated RTL, and infor- mation about a new manual. Both the compiler and RTL are required in order to support the functionality and bug fixes listed within these release notes. You should continue to use the DIGITAL COBOL V2.5 doc- umentation set with Compaq COBOL V2.6. All new functionality for V2.6 is documented in these release notes. These release notes should be made available to all users of Compaq COBOL. The release notes include many details to help facilitate migrations from and coexistence between Compaq COBOL on the four supported plat- forms. Additional details concerning differences between Compaq COBOL on the Alpha platforms appear in the documentation. When a release note is specific to a particular platform, one or more of the following tags are used: o [OpenVMS] o [UNIX] o [Windows NT] Compaq COBOL V2.6 requires one of the following: o OpenVMS Alpha V6.2 or higher o DIGITAL UNIX V4.0D, V4.0E or Tru64 UNIX V4.0F or higher o Windows NT Alpha 4.0 SP3 or SP4 Compaq COBOL V2.6 includes the following new functionality, new doc- umentation, and bug fixes beyond DIGITAL COBOL V2.5: o Product name change to Compaq COBOL o DIGITAL COBOL Multiplatform Overview & Compatibility Guide o 31-digit numeric user items (up from ANSI-85 18-digit numeric user items) o 32-digit intermediates with /MATH=CIT4 (up from /MATH=CIT3 18-digit intermediates) o Improved Compaq COBOL for OpenVMS VAX compatibility with /MATH=CIT3 and exponentiation o Additional COPY directories (/INCLUDE) o New Y2K intrinsic functions (some with sliding window support) o PROCEDURE DIVISION GIVING and X/Open RETURN-CODE with EXIT PROGRAM (/STANDARD=V3) and STOP RUN Compaq COBOL V2.6 Release Notes 1 o Option for automatic DISPLAY WITH CONVERSION o Integration of GEM BL42 o [OpenVMS] SYS$CURRENCY support o [OpenVMS] Limited support for 64-bit pointers o [OpenVMS] Option for initialization of literals from CDD o [UNIX] improved driver support for -shared o [Windows NT] cobfunc, cobcall, cobcancel o [Windows NT] Debug improvements regarding case sensitivity (/DEBUGCASE) o [Windows NT] Debug improvements for user names with hyphens o [Windows NT] Support for WINDBG 4.0 (included with kit) o [Windows NT] Improved compatibility with Visual C++ 5.0 o [Windows NT] Sample programs with Visual Basic directly calling COBOL o [Windows NT] X/Open SCREEN SECTION COLOR, integration of Crystal Curses V2.0, and numerous other screen handling improvements o [Windows NT] New compile and link option support in the Interac- tive Compiler Driver o [Windows NT] Integration of Hypersort V4 o [Windows NT] Integration of Adobe Acrobat Reader V3.1 o Several bug fixes (see details that follow) 1.1 Windows NT Alpha Additional Information The Compaq COBOL kit for Windows NT Alpha includes some components un- der license from Microsoft including: o Linker o Librarian o WINDBG o C++ run-time support These tools are compatible with Microsoft Visual C++ 5.0 for Windows NT Alpha. Generally, Compaq COBOL for Windows NT Alpha can be used with any language or debugger compatible with Microsoft Visual C++ 5.0 for Windows NT Alpha. The key change in going from compatibility with Mi- crosoft Visual C++ 4.1 (DEC COBOL V2.4, DIGITAL COBOL V2.5) to com- patibility with Microsoft Visual C++ 5.0 (Compaq COBOL V2.6) is sup- port for 32-bit CodeView debug symbol table records instead of 16-bit CodeView debug symbol table records. Note that debugger versions prior to WINDBG 4.0 and Visual Studio 5.0 support 16-bit CodeView only and therefore cannot be used with any Com- paq COBOL objects compiled with a version prior to V2.6. 2 Compaq COBOL V2.6 Release Notes Compaq COBOL V2.6 for Windows NT Alpha includes most of the function- ality from Compaq COBOL for OpenVMS Alpha and DIGITAL UNIX. The key pieces of functionality not available with Compaq COBOL on Windows NT Alpha include: o Tape handling (not planned for Windows NT Alpha) o Extended ACCEPT/DISPLAY support for BLINK See the compatibility matrix at the end of the release notes for a com- plete summary of the functionality available across the four platforms supported by Compaq COBOL. Compaq COBOL V2.6 Release Notes 3 1.2 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 or RTL. The version number of the compiler is printed at the top of each page of the source listing generated by the compiler. For example, if the following string appears in the top line: Compaq COBOL V2.6-1060 then the compiler is Version V2.6, edit number 1060. The compiler version number is also displayed as follows: [OpenVMS] ANALYZE/IMAGE SYS$SYSTEM:COBOL.EXE [UNIX] cobol -v [Windows NT] COBOL /WHAT The version number for the V2.6 run-time library is V2.6-467 for the following: [OpenVMS] DEC$COBRTL.EXE [UNIX] libcob.so [UNIX] libcob.a [Windows NT] dcob.dll To verify the version of the run-time library: [OpenVMS] ANALYZE/IMAGE SYS$LIBRARY:DEC$COBRTL.EXE [UNIX] what /usr/shlib/libcob.so [UNIX] what /usr/shlib/libcob.a [Windows NT] link /dump /headers %dec_cobol_dir%\bin\axp\dcob.dll | find "image version" In addition, the version number for the V2.6 decimal support run-time library is V2.6-46 for the following: [OpenVMS] LIBOTS2.EXE [UNIX] libots2.so [UNIX] libots2.a The run-time library is included with Compaq COBOL V2.6. [Windows NT] On Windows NT Alpha, libots2 is integrated into dcob.dll. Also, you must purchase a separate license for the run-time library to use it on a system not licensed for Compaq COBOL V2.6. 4 Compaq COBOL V2.6 Release Notes 1.3 Problems Corrected Since DIGITAL COBOL V2.5 Problems corrected that do not apply to all 3 Alpha platforms are tagged with o [OpenVMS] o [UNIX] o [Windows NT] The list below includes all problems corrected since the V2.5 release of DIGITAL COBOL (V2.5-961). ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 The compiler now correctly generates code for use on EV6 systems. V2.6-1060 The machine listing (/MACHINE/LIST) now correctly han- dles PACKED-DECIMAL (COMP-3) variables. V2.6-1060 The compiler now correctly handles routines with an empty PROCEDURE DIVISION. Previously, LINK of such routines would result in undefined symbols. V2.6-1060 /MATH=CIT3 and /MATH=CIT4 are now supported for use in functions. Previously, /MATH was ignored in expressions involving functions. V2.6-1060 The compiler now correctly handles NUMVAL when /MATH=FLOAT /FLOAT=IEEE is specified. V2.6-1060 The compiler now correctly handles E-style integer con- stants. V2.6-1060 When debugging a program which was compiled with /CHECK= DECIMAL (-check decimal) and a decimal exception occurs, the visible source line will not jump to a line that did not trigger the decimal exception. [OpenVMS] After the %SYSTEM-F-DECINV error is triggered, the traceback line number is now correct. V2.6-1060 The compiler now correctly updates the values for RMS Spe- cial Registers for condition clauses and in the UNTIL clause of the PERFORM verb. Compaq COBOL V2.6 Release Notes 5 ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 An error in the compiler that could cause the wrong WHEN phrase to be selected has been corrected. This problem could occur in an EVALUATE statement when either the sub- ject item or the object item was a national variable (de- scribed by a PICTURE character-string containing the sym- bol N). V2.6-1060 A problem has been corrected in the handling of COMPUTE statements that divide decimal or integer variables or expressions by powers of 10 expressed using the exponen- tiation operator (**). V2.6-1060 The compiler now correctly handles SORT/MERGE with vary- ing length records when the SORT file is specified with- out DEPENDING ON but the input files are specified with DEPENDING ON. V2.6-1060 The compiler no longer has a limit of approximately 600 for the number of o REPORT WRITER sections o USE procedures o Contained programs V2.6-1060 /CONDITIONALS (-conditionals) with no selector specified now works correctly with all conditional compilation lines compiled. [Windows NT] An invalid /CONDITIONALS value is now di- agnosed correctly. V2.6-1060 [OpenVMS] The RTL installation procedure no longer gives the error %INSTALL-I-NONSHRADR, image installed ignoring 'SHARE=ADDRESS' on OpenVMS Alpha V7.2 and higher systems if all privi- leges are not enabled during the installation. V2.6-1060 [OpenVMS] A problem with WRITE AFTER ADVANCING PAGE for a LINAGE file with TOP defined has been corrected. The first logical page is now positioned correctly. V2.6-1060 [OpenVMS] A problem has been corrected with the run-time library concerning an internal consistency check during a WRITE statement on an INDEXED file when following START statements using an alternate key and the relational op- erator ">". 6 Compaq COBOL V2.6 Release Notes ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 [OpenVMS] A problem has been corrected in the compiler's processing of the WHERE clause of the DBMS DML FETCH and FIND statements for a non-database data-item of usage COMP- 3. The problem caused the length of the data-item to be improperly truncated, which caused incorrect data to be retrieved from the database. V2.6-1060 [OpenVMS] The compiler's handling of a comma list in the command line conforms more closely with Compaq COBOL for OpenVMS VAX for modules with just ANSI ACCEPT/DISPLAY (as opposed to modules with extended ACCEPT/DISPLAY). V2.6-1060 [UNIX] Programs which depend on floating exception han- dling now can be built and run -call_shared on Tru64 UNIX V5.0 and higher. Previously, programs which depended on floating exception handling and were intended to be run on Tru64 UNIX V5.0 and higher had to be built -non_shared, had to be run with Hypersort V3.0, or had to have the sys- tem configuration switch use_faulty_fpe_traps set to 1. This relates to a change in Tru64 UNIX V5.0 where a float- ing divide by 0 now returns a HPARITH trap or FLTDIV trap instead of an FLTDIV fault. V2.6-1060 [UNIX] COBOL programs can be linked -non_shared on Tru64 UNIX V5.0 and higher. Previously, attempts to link COBOL programs -non_shared on Tru64 UNIX V5.0 resulted in un- defined symbols. V2.6-1060 [UNIX] The RTL now uses the PATH variable to determine the location of the executable program, while previous versions assumed the executable was in the current di- rectory. V2.6-1060 [UNIX] The driver now properly handles -shared. V2.6-1060 [UNIX] A compiler failure when producing listing maps in declared order for nested programs has been corrected. V2.6-1060 [UNIX, Windows NT] The compiler now reports a warning di- agnostic if IDENT is specified for a platform that does not support IDENT. V2.6-1060 [Windows NT] The compiler driver no longer gets an ac- cess violation when a directory specification is given for a directory which cannot be found. V2.6-1060 [Windows NT] The compiler driver now properly handles negated options with values. Compaq COBOL V2.6 Release Notes 7 ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 [Windows NT] The compiler driver now properly handles /NOOBJECT. V2.6-1060 [Windows NT] The compiler now properly exits for abort errors. V2.6-1060 [Windows NT] The compiler now sets %errorlevel% to 1 for -E- (error) level diagnostics so that the return status is compatible with compilers from Microsoft. V2.6-1060 [Windows NT] /NOCONDITIONALS is now recognized as a valid option. V2.6-1060 [Windows NT] The compiler will now generate an informa- tional diagnostic when the ALLOWING UPDATERS clause is specified on a READ of an ISAM file. If the record is to be shared, a record lock will not be detected by this READ. V2.6-1060 [Windows NT] For consistency with other platforms, run- time file specifications are now trimmed to remove lead- ing and trailing spaces. ___________________________________________________________________ 8 Compaq COBOL V2.6 Release Notes 1.4 Restrictions and Known Problems ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 Compaq COBOL V2.6 requires one of o OpenVMS Alpha V6.2 or higher o DIGITAL UNIX V4.0D, V4.0E or Tru64 UNIX V4.0F or higher o Windows NT Alpha 4.0 SP3 or SP4 Prior to 01-Jan-2000, you should upgrade your operating system to a Y2K-compliant version. Even though Compaq COBOL V2.6 will install on some operating system versions that are not Y2K-compliant, as of 01-Jan-2000 Compaq COBOL will be supported only when used on a Y2K-compliant version of the operating system. V2.6-1060 [UNIX] Programs built -call_shared (the default) with DIG- ITAL COBOL V2.5 or earlier require the file /usr/shlib/osf.1/libcurses.so. which can be installed from the optional subset OSFOB- SOLETE supplied with your Tru64 UNIX installation kit. If you have programs built -call_shared with DIGITAL COBOL V2.5 or earlier, and you do not have the OSF.1 version of libcurses.so installed, the programs will not load, and the following fatal error will be seen at load time: a.out /sbin/loader: Fatal Error: object libcurses.so from liblist in a.out has version "osf.1", which does not match the found object: /usr/shlib/libcurses.so (with version "xpg4") If you rebuild your programs with Compaq COBOL V2.6, you do not need to install OSFOBSOLETE. V2.6-1060 To obtain all relevant V2.6 bug fixes and to use all V2.6 functionality, you must use the latest Compaq COBOL RTL. V2.6-1060 External names with the following prefixes are reserved for use by Compaq COBOL: COB$, DCOB$, cob_. V2.6-1060 Because of the differences in the way expressions are eval- uated in a COMPUTE between Compaq COBOL for OpenVMS VAX and Compaq COBOL on Alpha, the number of divide by 0 and undefined exponentiation diagnostics may vary between Com- paq COBOL for OpenVMS VAX and Compaq COBOL. Compaq COBOL V2.6 Release Notes 9 ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 When an exponent has a scaling factor and both operands have the value 0 and the operation is done in floating point, the size error condition should be raised, but the value 1 is returned instead. V2.6-1060 If a COMPUTE statement with an ON SIZE ERROR clause has more than one divisor whose value is 0, the run-time li- brary will erroneously issue the message "cobrtl: error: divide by zero; execution continues" V2.6-1060 The scope of EXTERNAL and DISPLAY UPON environment vari- able or OpenVMS logical is the current run unit. These language features do not preserve data between run units. V2.6-1060 If a nonnumeric literal is continued across a line break, converting the file from terminal format to ANSI format using the reformat utility causes blanks to be inserted in the literal at the point of the line break. This can result in a literal that is longer than the PIC clause, causing a syntax error. V2.6-1060 See the section "Debugger Notes" for problems and restric- tions specific to debugging with Compaq COBOL. V2.6-1060 SORT/MERGE does not support octaword binary keys on any platform except in the case on OpenVMS Alpha where the file SYS$LIBRARY:SORTSHR.EXE is used. SORTSHR.EXE is the default on OpenVMS Alpha. V2.6-1060 [OpenVMS] If you are using OpenVMS Alpha V7.1 with any version of DEC COBOL or Compaq COBOL and you attempt to LINK with /THREADS_ENABLE, then you must have the ALP- SYS11_071 ECO installed. Note that Compaq COBOL programs are NOT thread-reentrant. V2.6-1060 [OpenVMS] If you are using OpenVMS Alpha V7.1 with ANY version of DEC COBOL, DIGITAL COBOL, or Compaq COBOL, make sure to apply RMS ECO ALPRMS01_071 if you use either of the following clauses: o APPLY EXTENSION o APPLY PREALLOCATION V2.6-1060 [OpenVMS] The minimum Oracle CDD/Repository version re- quired for Compaq COBOL for OpenVMS Alpha is CDD/Repository V5.3. 10 Compaq COBOL V2.6 Release Notes ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 [OpenVMS] The minimum Oracle DBMS version required for Compaq COBOL is Oracle DBMS V5.1A. Use of the Compaq COBOL DBMS support requires the separate COBOL-DBMS license/PAK; see the Compaq COBOL SPD for more information. V2.6-1060 [OpenVMS] RECORD IS VARYING is not supported with RMS RU- Journaling. V2.6-1060 [OpenVMS] Stream_Lf files (ORGANIZATION LINE SEQ or se- quential VFC files with /NOVFC) are not supported for file- sharing (ALLOWING ALL or READERS) when opened for writ- ing. V2.6-1060 [OpenVMS] Stream_LF files (ORGANIZATION LINE SEQUENTIAL or ORGANIZATION SEQUENTIAL with /NOVFC) are not currently supported if the file is assigned to a network device. V2.6-1060 [OpenVMS] If you mix ANSI ACCEPT statements and extended ACCEPT statements in one program, the RECALL (UP-arrow or DOWN-arrow) will not be supported for the ANSI ACCEPT statements. V2.6-1060 [OpenVMS] Attempts to write before the end of data (OPEN EXTEND) when using a TZK10 drive (a quarter-inch cartridge (QIC) standard drive) result in a write append error. This is a restriction in the QIC standard. The QIC standard allows drives to write at the end of data (append) or write the entire tape from beginning of tape (BOT), but does not allow writing before the end of data. This restriction applies to all OpenVMS Alpha hardware platforms that support the TZK10 drive. Compaq COBOL V2.6 Release Notes 11 ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 [OpenVMS] There are known problems with CDD/Repository regarding translation of quadword INITIAL_VALUEs. Some values are not converted correctly and will not produce a COBOL VALUE clause or a diagnostic message. Specifically, quadword fields with initial values that cannot fit into a quadword are silently ignored. This oc- curs in one of the translation layers of CDD and is not reported to the compiler. Initial values that are 19 digits in length which will fit into a quadword, but exceed the length of a COBOL lit- eral are detected and flagged by the compiler with a di- agnostic. Initial values that are 18 digits or less work correctly. The initial value clauses for all unsigned quadwords are ignored by the compiler. Again, this occurs in a CDD trans- lation layer and cannot be detected by the compiler. This occurs with the Compaq COBOL for OpenVMS VAX compiler as well as the Compaq COBOL compiler. V2.6-1060 [UNIX] The following cannot be used in a stripped image: o CANCEL o CALL dataname o cobfunc, cobcall, and cobcancel o Compaq COBOL for OpenVMS VAX compatible extended AC- CEPT/DISPLAY o X/Open SCREEN SECTION V2.6-1060 [UNIX] CANCEL, CALL dataname, cobfunc, cobcall, and cob- cancel use nlist on the main executable image. This means that these references cannot be from the main executable image to a shared object. V2.6-1060 [UNIX] You must use ltf (logical tape facility) to ini- tialize ANSI labeled magtapes. V2.6-1060 [UNIX] When you compile COBOL and non-COBOL objects and/or sources together, you must specify the COBOL ones before the non-COBOL ones on the command line. If you put the non-COBOL objects/sources first, the resulting executable will contain unresolvable loader symbols and will not run. V2.6-1060 [UNIX] For COBOL programs to access files served from UCX file-systems, you must turn off the default file lock- ing by using the -nolocking flag. 12 Compaq COBOL V2.6 Release Notes ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 [UNIX] A COBOL application will abort if it tries to AC- CEPT from any device mapped to stdout or stderr, and the application will abort if it tries to DISPLAY to any de- vice mapped to stdin. If you define the corresponding environment variables to devices other than stdout, stderr, and stdin, the above problems do not occur. V2.6-1060 [UNIX] There is a potential "input file reading" prob- lem with ULTRIX Connection Software (UCX) V2.0 or higher. The export option DATA_CONVERSION is turned on by default. The behavior, as described in the UCX release notes, is as follows: When DATA_CONVERSION is on, sequential non- stream_LF files are automatically converted to stream_ LF files for READ_ONLY access. Note that the conversion is done "on-the-fly", that is, the file remains in the sequential format on disk; only the data sent to the re- mote NFS client are converted. There is a difference in the file size between the orig- inal sequential non-stream_LF file (on the server side) and the converted stream_LF file (on the client side and cached by the client). To prevent the occurrence of an "input file reading" prob- lem, ask your system manager to turn off the DATA_CONVERSION option. V2.6-1060 [UNIX] On a UCX-served disk, some file names are ille- gal that are legal in Compaq Tru64 UNIX on disks that are not UCX-served; for example, "a.dat.dat". V2.6-1060 [UNIX] When the NFS server is an ULTRIX system, it must be running Version 4.2 or greater of the ULTRIX lock de- mon for your program to access files on the NFS-served disks. Otherwise, your program will hang. Superuser priv- ilege will be required to kill your process. V2.6-1060 [UNIX] When compiling in the FUSE environment (using the compiler options -xref or -xref_stdout), certain COBOL programs may raise this fatal FUSE diagnostic: cobol: Severe: Fatal error -7 returned from a cross-referencing library procedure To avoid this FUSE restriction, COBOL programs must ad- here to this rule: Any copy file that contains a PROGRAM- ID or END PROGRAM statement for a program must contain that entire program. This restriction also applies to debugging COBOL programs with Ladebug. Compaq COBOL V2.6 Release Notes 13 ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 [UNIX] The FUSE editor does not completely support COBOL programs with successive COPY statements where there are no intervening data item references or declarations. With these COBOL programs, the FUSE Editor cannot be used to display the file for COBOL items which are clicked on from the Cross-Referencer. To work around this FUSE restric- tion, insert an extra declaration between successive COPY statements in the DATA DIVISION: COPY "LIBRARY-1". 01 EXTRA-ITEM PIC X. COPY "LIBRARY-2". and insert an extra reference to a data item between suc- cessive COPY statements in the PROCEDURE DIVISION: DISPLAY "TEST 7". COPY "LIBRARY-1". move "1" to extra-item. COPY "LIBRARY-2". V2.6-1060 [UNIX] When a shared object is created and a COBOL main entry point (_cobol_main) is identified, there is no way to create a different _cobol_main when building the ex- ecutable image when -call_shared is specified. For example, ld -shared -o util.so util1.o util2.o util3.o ... ld -call_shared -o mainp mainp.o subp.o util.so ... When mainp runs, util1 is the code that is executed. The workaround is to create mainp.so. 14 Compaq COBOL V2.6 Release Notes ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 [UNIX, Windows NT] ORGANIZATION INDEXED requires a sep- arately licensed 3rd party product. On Compaq Tru64 UNIX, Informix C-ISAM version V5.00 is required. C-ISAM can be ordered from Informix: Product: Informix C-ISAM Available From: Informix USA: 1-800-331-1763 UK: 44-1784-42-2000 Singapore: 0718-65-298-1716 Japan: 81-3-5562-4599 WWW: http://www.informix.com On Windows NT Alpha, Sector 7 ISAM 19-Dec-1997 vxisam.dll is required. vxisam.dll can be ordered from Sector 7: Part Number: VXISAM-NTIA Available From: Sector 7 Group USA: 1-800-867-8640 UK: +44 (0)1536-408588 Internet: sales@sector7.com WWW: http://www.sector7.com V2.6-1060 [Windows NT] The Compaq COBOL run-time library is avail- able as a DLL only (dcob.dll). Therefore, an application built on a particular system requires that the Compaq COBOL run-time library DLL be installed on any other system on which the application is to be run. A separate run-time kit is available, and you must purchase a separate li- cense for the run-time library to use it on a system not licensed for Compaq COBOL V2.6. V2.6-1060 [Windows NT] Due to a Visual Basic restriction, COBOL can- not CALL a Visual Basic DLL. V2.6-1060 [Windows NT] The PROCEDURE DIVISION of a COBOL program called by cobcall or cobfunc can contain a GIVING phrase specifying a function result. The GIVING identifier must be a longword integer COMP data item. The identifier can- not be subscripted, but it can be qualified. V2.6-1060 [Windows NT] If a data item is declared as EXTERNAL and its name is 1 character in length (for example E) and the program is compiled for debugging, during the link phase, you will see the following warning: CVPACK : warning CK4002: duplicate public symbol E in module The warning can be ignored. Symbol E in this example is valid in the executable image for debugging. Compaq COBOL V2.6 Release Notes 15 ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 [Windows NT] The Windows NT Alpha utility which converts DLLs and EXEs so that lookup of external routine names is done by ordinal position rather than by name cannot be used with Compaq COBOL. Compaq COBOL does not support references to DCOB.DLL from other DLLs and EXEs on which this utility has been run. V2.6-1060 [Windows NT] The installation procedure and the Inter- active Compiler Driver require a screen resolution of 800x600 or higher. V2.6-1060 [Windows NT] Tape handling is not supported. V2.6-1060 [Windows NT] EXTERNAL in a run unit built as a DLL is not currently supported. V2.6-1060 [Windows NT] ACCEPT/DISPLAY screen handling does not sup- port BLINK. V2.6-1060 [Windows NT] The keypad containing the numerics, and the function keys at the top of the keyboard, are not detected by the Compaq COBOL runtime system. 16 Compaq COBOL V2.6 Release Notes ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 [Windows NT] File sharing and record locking are gener- ally supported, but some restrictions exist: File Sharing: o A unique access stream is created whenever an OPEN state- ment is executed for a physical file that has a sep- arate FD. This may occur in a single run unit or across different run units. o For INDEXED files, OPEN ALLOWING READERS is minimally supported and is not recommended. Record Locking: o For all file types, the ALLOWING READERS option of READ and START is not supported. o For all file types, the REGARDLESS option of READ and START is not supported. For SEQUENTIAL files, this means that no subsequent READs can be done when a FILE STATUS 92 occurs until the record is free. For INDEXED and RELATIVE files, a START can be used to position beyond the locked record. o For INDEXED files, the ALLOWING UPDATERS option on a READ prevents the READ statement from detecting a locked record. o For INDEXED files, START does not detect a locked record. o For SEQUENTIAL and RELATIVE files, there is a limit of 200 record locks per access stream. This may af- fect programs with manual locking that neglect to per- form UNLOCK statements on a regular basis. V2.6-1060 [Windows NT] ORGANIZATION INDEXED is currently limited to 254 keys. V2.6-1060 [Windows NT] Compaq COBOL run units currently require that a Compaq COBOL routine be the first routine built into the run unit. No routines included in the run unit can have the name 'main'. This restriction is to ensure that Compaq COBOL exception handling operates correctly. ___________________________________________________________________ The table above is a summary of many of the restrictions and known prob- lems. For further details on these known problems and restrictions, or for other restrictions in using the product, see o DIGITAL COBOL Reference Manual or Online Reference o DIGITAL COBOL User Manual o DIGITAL COBOL User Manual for Windows NT Alpha Compaq COBOL V2.6 Release Notes 17 2 Recent Enhancements 2.1 CIT3 18-Digit Intermediates The COBOL language allows users to declare data up to 18 decimal dig- its. Both Compaq COBOL and Compaq COBOL for OpenVMS VAX provide ex- tended arithmetic precision for intermediate computations generally up to 31 decimal digits. When the compiler issues the INTERMED diag- nostic with /WARNINGS=ALL (-warn all), Compaq COBOL for OpenVMS VAX switches to CIT/CIT2 (COBOL Intermediate Temp) as the intermediate data type and Compaq COBOL switches to double precision floating. CIT3 provides increased arithmetic compatibility with Compaq COBOL for OpenVMS VAX. When this option is chosen, Compaq COBOL switches to CIT3 as the intermediate data type instead of double precision floating. CIT arithmetic maintains a base containing the most significant 18 dec- imal digits of an arithmetic operation and an exponent in the range -99...+99 representing a power of 10. To use CIT3, use the following new qualifier in your compilations: [OpenVMS] COBOL /MATH_INTERMEDIATE=CIT3 [UNIX] cobol -math_intermediate cit3 [Windows NT] COBOL /MATH_INTERMEDIATE=CIT3 CIT3 is disabled by default, so the default arithmetic behavior with Compaq COBOL generally matches earlier versions of DIGITAL COBOL and DEC COBOL (with the exception of bug fixes). Following is a brief summary of differences between Compaq COBOL and VAX COBOL arithmetic with CIT3 enabled in Compaq COBOL: o Invalid decimal data In Compaq COBOL, invalid decimal data detection takes place before any possible conversion to CIT3. CIT3 operations on data items con- taining invalid decimal data will get results compatible with Com- paq COBOL rather than Compaq COBOL for OpenVMS VAX. o Floating-point data items In Compaq COBOL, expressions involving COMP-1 or COMP-2 data items will be converted to G_floating (on OpenVMS Alpha) or T_floating before conversion to CIT3. CIT3 operations involving D_floating (on OpenVMS Alpha) data items, in particular, will get results compat- ible with Compaq COBOL rather than Compaq COBOL for OpenVMS VAX. o Undefined results If an abnormal condition arises during a CIT3 operation, for ex- ample, INTEXPOVE (intermediate exponent overflow), and the program manages to continue, and it is not an arithmetic statement with an ON SIZE ERROR clause, then the values that get stored in destina- tion items will be undefined. Compaq COBOL and Compaq COBOL for Open- VMS VAX are highly likely to get different undefined results in such cases. o STANDARD dependency 18 Compaq COBOL V2.6 Release Notes The Compaq COBOL for OpenVMS VAX /STANDARD qualifier has an effect on when arithmetic expression analysis switches to one of the CIT forms. With /STANDARD=V3 (-std v3), CIT is used when more than 18 digit intermediate results are needed. With /STANDARD=85 (-std 85), CIT is used when more than 31 digit intermediate results are needed. The Compaq COBOL implementation on Alpha is compatible with Com- paq COBOL for OpenVMS VAX /STANDARD=85. o Special contexts The CIT3 implementation concentrated on the arithmetic statements ADD, SUBTRACT, MULTIPLY, DIVIDE, compare, and COMPUTE. The compiler does not provide CIT3 support equivalent to Compaq COBOL for Open- VMS VAX's CIT/CIT2 support in the following contexts: - Expressions in reference-modification components - Expressions in INSPECT, STRING, and UNSTRING statements - Intrinsic functions MEDIAN, NUMVAL, and NUMVAL-C 2.2 31-Digit User Items Summary of new functionality: o The maximum number of digits in a picture character string describ- ing fixed-point numeric and numeric-edited data items is raised from 18 to 31. o The maximum number of digits in numeric literals is raised from 18 to 31. o The maximum number of characters in a picture character string is raised from 30 to 50. o The maximum number of digits now supported in most intrinsic func- tions is raised from 18 to 31. o The maximum number of digits now supported for numeric SORT/MERGE keys is raised from 18 to 31. o The maximum number of digits now supported for PACKED-DECIMAL (COMP- 3) numeric and unsigned DISPLAY numeric ISAM keys is raised from 18 to 31. o The compiler no longer issues a diagnostic for PICTURE clauses with digits in the range 19-31. o The compiler diagnostic text for OPDGIVING has been modified to re- flect that PROCEDURE DIVISION USING and CALL GIVING do not support octaword binary integers and to clarify the rules for scaled operands. o [OpenVMS] The compiler now provides improved CDD support for nu- meric items with digits in the range 19-31. The following table shows primitive COBOL data types, organized by US- AGE, and whether they are impacted by the 31-digit requirements. Compaq COBOL V2.6 Release Notes 19 ___________________________________________________________________ USAGE_____________ImpactedNotes____________________________________ COMPUTATIONAL Y Integer family COMPUTATIONAL-1 N Single precision floating-point COMPUTATIONAL-2 N Double precision floating-point COMPUTATIONAL-3 Y Packed-decimal DISPLAY Y Display numeric INDEX N Longword integer POINTER N Longword or quadword integer ___________________________________________________________________ "Y" in the Impacted column means the data type is affected by the 31- digit requirements; "N" means the data type is not affected. 31-digit user items are not supported for COMP-1 and COMP-2. The following table shows examples of COBOL constructs that are now valid. ___________________________________________________________________ Code_fragment___________________________________Notes______________ 01 A PIC S9(31). Display numeric item 01 A PIC S9(16)P(15). Display numeric item 01 A PIC $(29).99. Numeric-edited item 01 A PIC S9(31) COMP. COMP item with 31 digits VALUE 1234567890123456789012345678901. Numeric literal ___________________________________________________________________ As is the case with all expressions in Compaq COBOL, intermediate tem- poraries are controlled with /MATH_INTERMEDIATE. As was the case with 18-digit maximum sizes, programs should not ar- bitrarily specify sizes significantly larger than the values actually anticipated for the application's lifetime. Although the new limits are useful for many applications, specifying 31 digits when 12 will suffice, for example, may add extra processing cycles and complexity that is wasteful. 2.3 CIT4 32-Digit Intermediates This section covers a new Compaq COBOL option available with Compaq COBOL V2.6. The recently added Compaq COBOL extension allowing numeric items with up to 31 decimal digits makes it quite easy to construct arithmetic expressions that may produce more than 31 digits. When such a situ- ation occurs, the compiler previously could choose between using double- precision floating-point (/MATH=FLOAT, the default) or CIT3 (/MATH=CIT3). The new option allows the compiler to choose CIT4 (/MATH=CIT4) instead. 20 Compaq COBOL V2.6 Release Notes CIT3 data items maintain a base containing the most significant 18 dec- imal digits of an arithmetic operation and an exponent in the range -99...+99 representing a power of 10. CIT4 data items maintain a base containing the most significant 32 decimal digits and an exponent with the same range. We strongly recommend that you choose this option with programs that make use of numeric items with more than 18 digits or when computations have several levels of nested expressions that gen- erate large intermediate requirements. To use CIT4, use the following new qualifier option in your compila- tions: [OpenVMS] COBOL /MATH_INTERMEDIATE=CIT4 [UNIX] cobol -math_intermediate cit4 [Windows NT] COBOL /MATH_INTERMEDIATE=CIT4 CIT4 is disabled by default, so the default arithmetic behavior with Compaq COBOL generally matches earlier versions of DIGITAL COBOL and DEC COBOL (with the exception of bug fixes). In addition to the precision difference, CIT4 arithmetic has the same differences and restrictions as shown in section 2.1, CIT3 18-digit Intermediates. Consider the following example. IDENTIFICATION DIVISION. PROGRAM-ID. MUL31. DATA DIVISION. WORKING-STORAGE SECTION. 01 XD PIC S9(31) VALUE 3. 01 YD PIC S9(31) VALUE 258718314234781388692555698765. 01 ZD PIC S9(31). PROCEDURE DIVISION. 0. MULTIPLY XD BY YD GIVING ZD ON SIZE ERROR DISPLAY "Size error raised" NOT ON SIZE ERROR DISPLAY ZD WITH CONVERSION. The compiler relies on the number of digits implied by the pictures of decimal and integer operands. Here it assumes that XD has 31 dig- its and YD has 31 digits. The product could require 62 digits, which is larger than the largest fixed-point arithmetic type available to the compiler. Depending on the intermediate datatype chosen, this pro- gram gets several different results. Intermediate maintains MATH ZD the most significant ----- ------------------------------ ---------------------- FLOAT 776154942704344283789821739008 53 bits CIT3 776154942704344164000000000000 18 digits CIT4 776154942704344166077667096295 32 digits Compaq COBOL V2.6 Release Notes 21 2.4 Additional COPY Directories (/INCLUDE) This release of Compaq COBOL provides a new command line qualifier to control where the compiler searches for COPY files for simple COPY state- ments. A "simple COPY statement" is defined as one where the COPY state- ment is Format 1 (without the OF/IN clause on Compaq Tru64 UNIX and Windows NT Alpha) and text-name is a file name without a directory spec- ification. The new qualifier is as follows: [OpenVMS] /INCLUDE=(dir1[,dir2...]) [UNIX] -include dir ... [Windows NT] /INCLUDE=(dir1[,dir2...]) "dir" can be a relative or absolute directory specification. On Open- VMS Alpha it may be a logical. On Windows NT Alpha or Tru64 UNIX it may be an environment variable. The compiler searches for the text file in the following order: 1. The current working directory when the compiler was invoked. 2. The directory specified after /INCLUDE (-include). If more than one directory is specified with the include qualifier, then the directories are searched in left to right order. The first file encountered that satisfies the COPY statement termi- nates the search. 2.5 Y2K (Year 2000) Summary of Support COBOL compilers and run-time libraries are Y2K compliant, and we've tried to foresee and forestall problems. But, powerful as these com- pilers are, it is not possible for them to identify many potential trou- ble spots in your programs, or to correct your applications. This is not what Y2K compliance is. Any needed changes must be searched out and implemented by you, the application programmers. Definitions of Y2K compliance can be found on the Internet at http://www.compaq.com/year2000 and also in IEEE P2000.1/D3.4 Draft Standard for Year 2000 Terminology, 1997 COBOL is not a strongly typed language, which means that programmers are not forced to specify the exact use of fields they are defining. Thus data stored in a field may or may not be a date. The compiler can- not tell. It helps when identifiers for fields are meaningful names (like PAYROLL- DATE or DATE-HIRED-YYYY-MMM-DD), but this is not a language require- ment. After all, the "convenient" short names PD and DH could just as easily have been specified for those two identifiers. 22 Compaq COBOL V2.6 Release Notes Two-digit year formats used in controlling fields or as keys in in- dexed files (just two examples of pitfalls) can cause fatal program logic problems as the year moves from "99" to "00"; so programmers are strongly urged to use four-digit years instead of two-digit years wher- ever sequential operations are driven by these values. COBOL programmers have access to two-digit year information through the Format 2 ACCEPT FROM (DAY/DATE) statement. The two-digit formats continue to be provided for necessary conformance to the ANSI Stan- dard and for compatibility. The four-character formats are preferable; and Compaq COBOL provides them for ACCEPT (also in Format 2) as an ex- tension. The use of two-digit years in ACCEPT statements does not nec- essarily mean your program will not handle the year 2000 transition gracefully. You can continue to use two-digit formats for external dis- plays of year information if you wish. It is in the internal program logic that they are dangerous. Compaq COBOL provides many four-digit year capabilities to assist pro- grammers doing Y2K upgrades of COBOL applications while preserving, where needed, two-digit year support as specified in the ANSI-85 stan- dard. Diagnostic support is available for detecting use of two-digit years in ACCEPT. Compaq COBOL also provides the four-digit year capabilities specified in the ANSI-89 standard addendum. Beyond the ANSI-89 four-digit year functions, Compaq COBOL provides additional ACCEPT support for four-digit years as specified in the ANSI- 9x draft standard. Support is also provided for five new Y2K functions as specified in the ANSI-9x draft standard. Three of these five new functions implement a sliding window algorithm. Are the potential Y2K dangers and disruptions exaggerated? We wish they were, but we think not. This is serious but not entirely a new issue. It was long referred to as "the decade issue" because programmers short- sightedly sometimes used one-digit year fields. This occurred in the 1960's and caused big problems on January 1, 1970. Now the problem is enormously worse. NOTE Use of a Y2K-compliant version of Compaq COBOL does NOT guaran- tee a Y2K-compliant application. The final responsibility for in- suring Y2K-compliance of a COBOL application rests with the COBOL application programmer who must appropriately use the four-digit year features provided in the language. The table below summarizes the two-digit year and four-digit year sup- port now available with Compaq COBOL. ANSI-85 standard - ACCEPT two-digit ACCEPT FROM DATE two-digit ACCEPT FROM DAY Compaq COBOL V2.6 Release Notes 23 ANSI-89 standard addendum - functions four-digit FUNCTION CURRENT-DATE four-digit FUNCTION DATE-OF-INTEGER four-digit FUNCTION DAY-OF-INTEGER four-digit FUNCTION INTEGER-OF-DATE four-digit FUNCTION INTEGER-OF-DAY four-digit FUNCTION WHEN-COMPILED ANSI-9x draft standard - ACCEPT four-digit ACCEPT FROM DATE YYYYMMDD four-digit ACCEPT FROM DAY YYYYDDD two-digit ACCEPT FROM DATE - diagnostic two-digit ACCEPT FROM DAY - diagnostic ANSI-9x draft standard - functions four-digit FUNCTION YEAR-TO-YYYY four-digit FUNCTION DATE-TO-YYYYMMDD four-digit FUNCTION DAY-TO-YYYYDDD four-digit FUNCTION TEST-DATE-YYYYMMDD four-digit FUNCTION TEST-DAY-YYYYDDD 2.6 Y2K Intrinsic Functions This version of Compaq COBOL includes five new intrinsic functions de- signed to assist you in coding Y2K programming solutions. They are: Date Conversion functions: FUNCTION YEAR-TO-YYYY FUNCTION DATE-TO-YYYYMMDD FUNCTION DAY-TO-YYYYDDD Date Testing functions: FUNCTION TEST-DATE-YYYYMMDD FUNCTION TEST-DAY-YYYYMMDD The date conversion functions are used for converting dates with two- digit year fields to dates with four-digit year fields. These func- tions use a sliding window or a fixed window algorithm to determine the century. Any windowing approach is recommended only for applica- tions whose dates span less than 100 years. Windowing may be appro- priate when a full conversion (including database, files, and so forth) to four-digit years is not possible or necessary. As always, your par- ticular application requirements control what date manipulation ap- proaches are best suited for your needs for Y2K and beyond. The date testing functions can be used to verify that date fields con- tain valid dates (with four-digit years) before you use them in fur- ther date processing (for example, as an argument to the INTEGER-OF- DATE function). For complete details on using these functions, see the Documentation section later in this document. 24 Compaq COBOL V2.6 Release Notes 2.7 Stop with Status Compaq COBOL now supports passing status back to the operating sys- tem for o RETURN-CODE o PROCEDURE DIVISION GIVING with o EXIT PROGRAM o STOP RUN Four of the data types supported by PROCEDURE DIVISION GIVING can be used in this new way. Here is a summary of what is now supported: RETURN-CODE (Alpha-only) EXIT PROGRAM /STA=V3 yes EXIT PROGRAM /STA=85 yes (except for Windows NT Alpha) STOP RUN yes PROCEDURE DIVISION GIVING EXIT PROGRAM /STA=V3 yes EXIT PROGRAM /STA=85 yes (except for Windows NT Alpha) STOP RUN yes (except for OpenVMS VAX) data types COMP-1,COMP-2 no PIC 9(04) COMP no PIC S9(04) COMP no PIC 9(09) COMP yes PIC S9(09) COMP yes PIC 9(18) COMP yes PIC S9(18) COMP yes PIC 9(31) COMP no PIC S9(31) COMP no In summary, some, but not all, of the PROCEDURE DIVISION GIVING data types can be used to communicate status to the operating system. This new support is still subject to the limitations on status han- dling imposed by the operating system. If PIC S9(18) COMP or PIC 9(18) COMP is used, the high-order 32 bits are truncated before the status is passed on to the operating system. To display the operating system status information, do the following: [UNIX] echo $status [OpenVMS] show symbol $status [Windows NT Alpha] echo %errorlevel% Note that this support replaces the temporary /SWITCH=DC_STOP_STATUS which is now obsolete. To get the supported behavior, uses of the tem- porary /SWITCH=DC_STOP_STATUS should be eliminated. Compaq COBOL V2.6 Release Notes 25 2.8 Automatic DISPLAY WITH CONVERSION DISPLAY of numeric data items no longer requires the WITH CONVERSION phrase if you compile with /SWITCH=DC_ENABLE_AUTODWC We welcome feedback on this new option. In subsequent versions of Com- paq COBOL, the manner in which this automatic conversion of numerics in DISPLAY is enabled will probably change. 2.9 [OpenVMS] Initialization Using Literals from CDD Initialization of literals from CDD is done using a literal VALUE rather than a figurative constant if you compile with /SWITCH=DC_CDD_INIT_LITERAL This provides initialization in this situation similar to DEC COBOL V2.3. We welcome feedback on this new option. In subsequent versions of Compaq COBOL, the manner in which this option for initialization of literals from CDD is enabled will probably change. 2.10 [OpenVMS] USAGE IS POINTER-64 OpenVMS Alpha V7.0 introduces the ability to dynamically allocate data in 64-bit address space. Compaq COBOL does not support data in 64-bit address space, but some limited use of it may be made. Compaq COBOL for OpenVMS Alpha has been enhanced to allow a data item to be described as USAGE IS POINTER-64. This may be useful if you are interfacing with an application in another language that requires a 64-bit pointer. You can use the SET statement or a VALUE clause to assign the address of a static COBOL variable to the pointer variable. The pointer vari- able can then be passed to any routine whose interface definition re- quires a 64-bit pointer. You can also use an appropriate system service or the Run-Time Library routine LIB$GET_VM_64 to allocate data and store the address in the pointer variable. Because COBOL does not support dynamic allocation, there is no way to dereference the pointer and access the allocated data. However, you can pass the pointer to other languages that may require a 64-bit pointer in 64-bit address space. 2.11 [OpenVMS] SYS$CURRENCY Support For programs that do not specify the CURRENCY SIGN clause, an alter- native to the default CURRENCY SIGN ($), may now be established with- out modifying the source program. The compiler will call LIB$CURRENCY which will retrieve the system or process currency sign. The process currency sign can be specified by defining the logical SYS$CURRENCY. 26 Compaq COBOL V2.6 Release Notes If the CURRENCY SIGN clause does not appear in the SPECIAL-NAMES para- graph of the ENVIRONMENT DIVISION of the user's COBOL program, the user can either continue to accept the system default currency sign, or uti- lize the DCL logical name SYS$CURRENCY to specify a currency symbol for the COBOL program. Only the first character of the logical SYS$CURRENCY will be utilized as the program's currency sign. At OpenVMS DCL command level, the user can either accept the value of the logical name SYS$CURRENCY (if defined) or define the SYS$CURRENCY logical as a quoted literal string containing up to 255 characters (of which only the first character is used by the Compaq COBOL compiler). Prior to compiling the COBOL program the user issues the OpenVMS DCL command: $ DEFINE SYS$CURRENCY "quoted-character-string" The COBOL compiler will utilize only the first character of this string as the currency symbol for the user's program. Subsequently, the system default value of the SYS$CURRENCY logical name can be restored for the process with the following DCL command: $ DEASSIGN SYS$CURRENCY Note: This enhancement is not utilized when /NATIONALITY=JAPAN is present on the compiler command line. 2.12 [Windows NT] Debugging Improvements Compaq COBOL V2.6 includes debugging improvements related to handling of user names with upper/lower case and hyphens and underscores. Because both WINDBG and Visual Studio debuggers are based on C lan- guage constructs, variable evaluation is case sensitive with these de- buggers. To assist in debugging Compaq COBOL programs that are case insensitive, COBOL has added a new compiler option that can help. This option does not create case sensitive variable names, but it may help users who consistently use one case or the other. /DEBUGCASE[:keyword] keyword(s): LOWERCASE,UPPERCASE default: /DEBUGCASE:UPPERCASE This option specifies mapping local variable names to uppercase or low- ercase for debugger handling. For debugging in a C language environ- ment, this option may help you if you consistently type your source code and debugger commands using one case or the other. WINDBG pro- vides an "ignore case" option that is very useful for debugging COBOL programs. If your source code variable names are entered in lowercase and you do not specify /DEBUGCASE:LOWERCASE, then the compiler upcases them when writing to the debugger symbol table. Attempts to evaluate those variables in the source window with highlighting will not be success- ful because those are always in lowercase. Variables entered in the watch window can be evaluated if the case used matches the case used in the debugger symbol table. Compaq COBOL V2.6 Release Notes 27 Because both WINDBG and Visual Studio debuggers are based on C lan- guage constructs where a hyphen is not a valid character in a vari- able name, Compaq COBOL now converts hyphens to underscores for de- bugging purposes. This does not affect evaluation when highlighting a source code variable with a hyphen, but it will help when using a watch window or a command window evaluation. Simply substitute an un- derscore for every hyphen in the name to be evaluated. 2.13 [Windows NT] Visual Basic Examples Calling COBOL DLL The Compaq COBOL kit for Windows NT Alpha includes two examples show- ing how to call a COBOL DLL from Visual Basic. The files are located in: DISK1\Examples\VisualBasic and four subdirectories example1 example1_src example2 example2_src To install example1 run "setup.exe" in the example1 subdirectory and follow the instructions. The installed example, "call01", is run by clicking start -> programs -> call01 then following the instructions in the example. To uninstall example1, click start -> settings -> control panel -> Add /Remove Programs, and select "call01". See the README.TXT in the example1 subdirectory for more information. Example2 highlights argument passing between COBOL and Visual Basic. To install example2 run "setup.exe" in the example2 subdirectory and follow the instructions. The installed example, "call02", is run by clicking start -> programs -> call02 then following the instructions in the example. To uninstall example2, click start -> settings -> control panel -> Add /Remove Programs, and select "call02". See the README.TXT in the example2 subdirectory for more information. 2.14 [Windows NT] ORGANIZATION INDEXED ISAM on Windows NT Alpha requires Sector 7 vxisam.dll. This file must be in your path to run Compaq COBOL programs with ORGANIZATION INDEXED. If you try to run a program with ISAM and vxisam.dll is not in your path, an error occurs when the RTL attempts to call one of the rou- tines in vxisam.dll. You must order vxisam.dll from Sector 7. See the ordering information earlier in these release notes. ISAM support on Windows NT Alpha is similar to support on Compaq Tru64 UNIX. The following are known problems based on our testing with the 19-Dec-1997 vxisam.dll from Sector 7: o Creating a file with 255 keys causes an error. (254 keys work fine.) 28 Compaq COBOL V2.6 Release Notes o Attempting to create a file with a file name containing too many characters (such that the full specification exceeds the maximum pathname allowed) causes an access violation instead of a proper diagnostic. o Opening a file with an empty .idx file causes a "file not found" error instead of a "corrupted file" error. o In a multi-user environment, when the first user has opened the file ALLOWING READERS, the file is not locked correctly. A subsequent user can WRITE to the file when an error should have been returned. Note that the compiler issues a diagnostic for the OPEN ALLOWING READERS limited support. o In an AUTOMATIC locking environment, a REWRITE does not release the current lock. An UNLOCK statement should be inserted. 2.15 [Windows NT] ACCEPT/DISPLAY Screen Handling ACCEPT/DISPLAY screen handling is supported on Windows NT Alpha with one exception: o BLINK (not planned for Windows NT Alpha) The following keyboards are recommended: o LK46W-A2 o PCXAL-AA o RT4958TW o RT6856T A separate window is created if your program includes any extended AC- CEPT or extended DISPLAY statements. The separate window is used ex- clusively for all extended DISPLAY output and all extended ACCEPT in- put including X/Open SCREEN SECTION input and output. If your program in addition includes any non-extended ACCEPT or DISPLAY statements, that input and output is NOT done through the separate window. If you run a program with extended DISPLAY and redirect output to a file, the program will create (but not use) the extended ACCEPT/DISPLAY window unless you also redirect input from a file. Note that you need to redirect input from a file even if the program has no ACCEPT to avoid the creation of the extended ACCEPT/DISPLAY window. The dimensions and font size of the separate window can be controlled with the following three environment variables: o COBOL_SCREEN_LINES (defaults to 24) o COBOL_SCREEN_COLS (defaults to 80) o COBOL_SCREEN_FONTSIZE (defaults to 7) When typing in an editable field, in addition to using the control (CTRL) and arrow keys, you can use the following keys: o insert - toggles between insert and overstrike mode Compaq COBOL V2.6 Release Notes 29 o home - moves the cursor to the beginning of the field o backspace - same as the "home" key o end - moves the cursor to the end of the field o delete - deletes the previous character, and moves back one (this differs from the behavior in command-line editing, where it deletes the current character) In addition, you can use the following keys: o alphanumeric o non-alphanumeric o control (CTRL) o alternate (ALT) The characters whose ASCII values range from 65 to 90, and 97 to 122 are called alpha characters. The characters whose ASCII values range from 32 to 127, excluding the alpha characters, are called non-alpha characters. The following keys are not supported: o numeric keypad o function keys along the top of the keyboard 2.16 [Windows NT] Interactive Compiler Driver (ICD) The following options have been added to ICD: o /DEBUGCASE=LOWERCASE o /DEBUGCASE=UPPERCASE o /LIST= o /EXE= o /EXTCOB= o /EXTLNK= o /INCLUDE= o /LINKMAP= o /USAGE= o /SEQUENCE_CHECK o /DLL o /LINK before linker options 30 Compaq COBOL V2.6 Release Notes 3 Run-Time Library Notes The V2.6 Compaq COBOL Run-Time Library included with Compaq COBOL V2.6 provides new functionality, new documentation, and several bug fixes beyond DIGITAL COBOL V2.5. You must use this updated RTL if you use the V2.6 Compaq COBOL compiler. 4 Debugger Notes 4.1 Debugger Notes for OpenVMS Alpha Please read the following release notes for information about COBOL language support in OpenVMS Alpha DEBUG V6.1-000. Also see the appendix on tools in the DIGITAL COBOL User Manual. If you are using a debugger newer than DEBUG V6.1-000, see the debug- ger release notes for information on corrections for some of the prob- lems listed below. 4.1.1 Restrictions Following are some restrictions with this debugger: o If you use the debugger to deposit data into Edited Picture vari- ables, an error message will be displayed and the deposit opera- tion will not be completed. The debugger session will not be com- promised, however, and may be continued after this error. The er- ror message is %DEBUG-F-BUG_CHECK, internal consistency check failure o The debugger divide operators for display numeric and packed dec- imal data items are not implemented. o When using the debugger, you may notice that variable names that contain underscores and hyphens may have been changed, under cer- tain circumstances. These problems have been corrected in the Open- VMS Alpha V7.1 debugger. Specifically, variable names that are "local" to your COBOL pro- gram (that is, names that are not visible to other separately com- piled program modules) have any underscores changed to hyphens when reported to the debugger. Thus, the data item "A_B" can only be ref- erenced as "A-B" in a debugging session. Names that are visible to other separately compiled program mod- ules (for example, EXTERNAL items, PROGRAM-ID names, etc.), have any hyphens in their names changed to underscores when reported to the debugger. Thus, the PROGRAM-ID name "SUBR-CALL" can only be ref- erenced as "SUBR_CALL" in a debugging session. 4.2 Debugger Notes for Tru64 UNIX Compaq COBOL V2.6 Release Notes 31 4.2.1 Features The following features are supported by the Ladebug debugger: o Specifying the following items using the COBOL language syntax: - Elementary and group identifiers, including subscripting and qual- ification - Numeric and nonnumeric literals - Arithmetic expressions o Printing (examining values) of all COBOL datatypes is supported, using the debugger's "print" command. o Assigning new values to all datatypes with the debugger's "assign" command. However, there are some known problems with assigning in the debugger; see below. o Assigning from numeric literals or from other program items. o Array access. o Simple arithmetic operations. However, full COBOL expression eval- uation is not supported. For example, the following simple addi- tion is supported: (ladebug) print itema + itemb 4.2.2 Restrictions Following are some restrictions in using Ladebug with Compaq COBOL programs: o Some Ladebug command usage is affected by COBOL language syntax such as hyphens in COBOL user names. This is true only when execution is stopped within a COBOL procedure, however. One effect is that expressions typed on the debugger command line must include spaces around arithmetic operators like "+" and "-". o Another effect of COBOL language syntax shows up in the debugger "memory-examine" command. For example, to look at the next 10 pro- gram instructions, you would normally use this debugger command: (ladebug) ./10i which means "from the current program location" (signified by the dot), examine the next 10 program locations (10 being the count) in instruction mode (signified by the "i"). When debugging COBOL programs, you must issue this command as follows: (ladebug) ./10 i with a space between the count and the mode indicator. o In specifying qualification of variables, only the "OF" qualifier keyword is supported, not the "IN" keyword. o Assignment to program items in the debugger: - Assigning new values to character string items (PIC X or PIC A) is not supported. 32 Compaq COBOL V2.6 Release Notes - The scales of the items involved must match. For example, given these declarations: 01 itema pic 9(9)v99. 01 itemb pic 9999v99. 01 bigitem pic 9(13)v9(5). the debugger will allow assignment of the values 1.23 or 1.20 or 8765.22 to itema, but will not allow assignment of the value 1.2 to itema. The following debugger commands are supported be- cause the quantities on both sides of the assignment operator "=" have the same scale: (ladebug) assign itema = 1.23 (ladebug) assign itema = 1.20 (ladebug) assign itema = 8765.22 (ladebug) assign itema = itemb and the following debugger commands are not supported because the quantities involved are of different scales: (ladebug) assign itema = 1.2 (ladebug) assign bigitem = itema - Items cannot be assigned values of greater precision. Using the above declarations, the following debugger command is not sup- ported, because itema has greater precision than itemb: (ladebug) assign itemb = itema - When assigning to numeric edited items, the precisions of the quantities on both sides of the assignment must be the same. If the righthand value is a literal, leading zeros must be entered. - Variable-occurrence arrays (i.e. containing OCCURS DEPENDING ON) are displayed using the maximum occurrence value. - When assigning to an integer or a float item, the source item cannot be a decimal data item (DISPLAY or PACKED-DECIMAL). This restriction includes using decimal items as subscripts. - A numeric literal on the right side of an assignment to a dec- imal item must be between -2147483648 and +2147483647. If the receiving item has a scaling factor, this restriction still ap- plies as if the scaling factor of the receiving item were ap- plied to these boundary values. o Qualification involving more than one intervening level will pro- duce a debugger error if the intervening level is an OCCURS item. For example, 01 grp1. 05 array-group occurs 6 times. 10 array-element pic s99. In the above group, "array-element" cannot be qualified (for ex- ample, "array-element of array-group (subscript)" will get an er- ror). However, "array-group of grp1 (subscript)" can be specified. Also array-element can be specified without qualification. Compaq COBOL V2.6 Release Notes 33 o Using the above code example, there is a problem where the address of array-element(i) is computed incorrectly when more than one data item is present in the same structure (for example, "array-group"). The address of element(i) should be computed using the stride value, but it is instead computed using the element size. Therefore, the address of array-element(i) will only be correct when the stride and the size have the same value (that is, when there is only one subordinate item in array-group). This problem is fixed with ladebug 4.0-44 or higher. o Subscripting is only supported for tables of one dimension. o Reference Modification is not supported by the debugger. o Stopping program execution at a program label (paragraph or sec- tion name) is not supported by the debugger. o The debugger does not correctly evaluate COBOL condition expres- sions. o The debugger does not support scaled octaword variables. o Debugging support inside COPY files is not supported. Instead, the source-line cursor will point to the line with the COPY statement during the execution of the statements inside the COPY file. (Note that multi-line COPY statements will use the last line of the COPY statement for this display.) o The "whereis" command does not permit qualification or subscript- ing. o There may be problems accessing external data items. o Ladebug does not currently support Static Parameters. Therefore, LINKAGE SECTION items that are referenced in USE or REPORT WRITER procedures are conveyed to Ladebug as local static variables rather than as parameters. This only affects debugging commands that nor- mally include a program's parameter lists (dump, where, etc.). All other debugging commands (print, assign, etc.) will work as expected. o Printing arrays of PACKED-DECIMAL (COMP-3) data items and PIC X may have problems. However, such items can be printed if they are sub- ordinate to an OCCURS group item. In that case, the structure con- taining the OCCURS clause can be printed as a workaround. 4.3 Debugger Notes for Windows NT Alpha Compaq COBOL includes some support for two debuggers - WINDBG and De- veloper Studio. WINDBG is included with the Compaq COBOL kit. Following are some restrictions with debugging: o Certain uses of EXTERNAL result in a CVPACK warning during link (see more details in the Restrictions section). o COMP-3 and DISPLAY numerics are not supported. (COMP, COMP-1 and COMP-2 numeric items are generally supported). 34 Compaq COBOL V2.6 Release Notes o Scaled binary (COMP) items are not supported. They do not display the decimal point. (for example, PIC 99V99 USAGE IS COMP VALUE 84.23 evaluates as 8423) o Unscaled binary (COMP) numerics with more than 18 digits are not supported. o Array evaluation is not supported. o User identifiers that include a hyphen are not fully supported. They are displayed with an underscore in the Local Variable window. To enter the name in a watch window, use an underscore instead of a hyphen. o In the watch window, all variables must be entered to match the /debugcase value (uppercase or lowercase). Uppercase is the default. o In the watch window, qualification must be done using "." (for ex- ample, GRP3.FLD1). o In the source window, evaluation by highlighting (if available in the debugger) is only supported for variables that are in the source code in the same case as the case specified with /DEBUGCASE (the default is /DEBUGCASE:UPPERCASE). o In general, you should utilize the WINDBG ignore case sensitivity option. o COB$USE is displayed as the name of the main program in the call stack when declaratives are present. Compaq COBOL V2.6 Release Notes 35 5 Documentation Notes 5.1 Documentation Changes and Updates ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 A new manual, the DIGITAL COBOL Multiplatform Overview & Compatibility Guide covering Compaq COBOL on all four platforms is now available. This manual in Adobe Acrobat- readable .PDF format is available on the COBOL web site for free download: http://www.openvms.digital.com/commercial/cobol The manual is intended for COBOL programmers using any of the following platforms: o OpenVMS VAX o OpenVMS Alpha o Compaq Tru64 UNIX o Windows NT Alpha This manual (also referred to as the MPG) provides ap- plication developers, engineering and system managers, and COBOL users with information on: o Maintaining existing applications on their current plat- form(s) o Migrating chosen applications to a new platform The MPG includes an easy-to-reference summary of Compaq COBOL's capabilities for: o Developing, debugging, and maintaining COBOL programs o Compiling, linking, and running COBOL programs o Modifying the COBOL command The MPG is an immediate source for valuable programming information such as: o The ASCII and EBCDIC tables o A comparative table of COBOL command modifiers for all four platforms V2.6-1060 [Windows NT] Chapter 6 page 6-188 on the DIGITAL COBOL Reference Guide and Online Reference has an incorrect ref- erence to file status 90. The third sentence of General Rule 25 should read [Windows NT] The REGARDLESS option for sequential and rel- ative files is not supported. If a locked record is en- countered, a hard-lock condition exists (file status 92). 36 Compaq COBOL V2.6 Release Notes ___________________________________________________________________ Version_______Description__________________________________________ V2.6-1060 [Windows NT] The DIGITAL COBOL Online Reference, the on- line DIGITAL COBOL User Manual for Windows NT Alpha and the online DIGITAL COBOL Multiplatform Overview & Com- patibility Guide require Adobe Acrobat Reader. Adobe Ac- robat Reader on Windows NT Alpha requires FX!32. Both Adobe Acrobat Reader and FX!32 V1.3A are included in the Com- paq COBOL kit, but are not automatically installed. See Chapter 1 in DIGITAL COBOL User Manual for Windows NT Al- pha for installation information. This manual is also in- cluded in hardcopy form with the development kit. Two versions of the online DIGITAL COBOL Multiplatform Overview & Compatibility Guide are included. One version has lower-resolution diagrams which load faster. V2.6-1060 [Windows NT] The documentation covers some features not available on Windows NT Alpha including: o ACCEPT/DISPLAY support for BLINK o Tape handling (not planned for Windows NT Alpha) ___________________________________________________________________ 5.1.1 Intrinsic Function Documentation Updates Chapter 7 of both the DIGITAL COBOL Reference Guide and Online Ref- erence will be updated to add the following function definitions. The documentation will also be updated to incorporate these new functions into existing function lists and tables as appropriate. The User Man- ual will be updated to incorporate these new functions in Section 1.9, "Special Information for Year 2000 Programming". Compaq COBOL V2.6 Release Notes 37 YEAR-TO-YYYY Description: The YEAR-TO-YYYY function converts arg-1, a two-digit year, to a four-digit year. The optional arg-2, when added to the current year (at the time the program executes), defines the ending year of a 100-year interval. This interval is used to determine to what cen- tury the two-digit year belongs. Format: FUNCTION YEAR-TO-YYYY ( arg-1 [ arg-2 ] ) Arguments: 1. arg-1 must be a nonnegative integer between 0 and 99. 2. arg-2 must be an integer. If it is omitted, the default value is 50. 3. arg-2, when added to the current year, must be between 1700 and 9999. Returned Value: The returned value is an integer representing a four-digit year cal- culated as follows: max-year = current-yyyy + arg-2 if mod(max-year, 100) >= arg-1 return (arg-1 + 100 * int(max-year / 100)) else return (arg-1 + 100 * int(max-year / 100) - 1) Examples: IF FUNCTION YEAR-TO-YYYY (80, 50 ) = 1980 DISPLAY "correct". IF FUNCTION YEAR-TO-YYYY (80, 100 ) = 2080 DISPLAY "correct". IF FUNCTION YEAR-TO-YYYY (80, -100 ) = 1880 DISPLAY "correct". Note: YEAR-TO-YYYY implements a sliding window algorithm. To use it for a fixed window, arg-2 can be specified as follows: (fixed-ending-year - function numval (function current-date (1:4))) If fixed-ending-year was 2100, then in 1999 arg-2 will have the value 101. If arg-1 was 50, the returned-value would be 2050. If arg-1 was 99, the returned-value would be 2099. 38 Compaq COBOL V2.6 Release Notes DATE-TO-YYYYMMDD Description: The DATE-TO-YYYYMMDD function converts arg-1, a year in the form YYmmdd to the form YYYYmmdd. Arg-2, when added to the current year (at the time the program executes), defines the ending year of a 100-year interval. This interval is used to determine to what cen- tury the two-digit year in arg-1 belongs. Format: FUNCTION DATE-TO-YYYYMMDD ( arg-1 [ arg-2 ] ) Arguments: 1. arg-1 must be a nonnegative integer between 0 and 999999. 2. arg-2 must be an integer. If it is omitted, the default value is 50. 3. arg-2, when added to the current year, must be between 1700 and 9999. Returned Value: The returned value is an integer representing YYYYmmdd and is cal- culated as follows: YY = int(arg-1 / 10000) mmdd = mod (arg-1, 10000) return FUNCTION YEAR-TO-YYYY(YY, arg-2) * 10000 + mmdd Examples: IF FUNCTION DATE-TO-YYYYMMDD (801123, 50 ) = 19801123 DISPLAY "correct". IF FUNCTION DATE-TO-YYYYMMDD (801123, 100 ) = 20801123 DISPLAY "correct". IF FUNCTION DATE-TO-YYYYMMDD (801123, -100 ) = 18801123 DISPLAY "correct". Note: DATE-TO-YYYYMMDD implements a sliding window algorithm. To use it for a fixed window, arg-2 can be specified as follows: (fixed-ending-year - function numval (function current-date (1:4))) If fixed-ending-year was 2100, then in 1999 arg-2 will have the value 101. If arg-1 was 501123, the returned-value would be 20501123. If arg-1 was 991123, the returned-value would be 20991123. Compaq COBOL V2.6 Release Notes 39 DAY-TO-YYYYDDD Description: The DAY-TO-YYYYDDD function converts arg-1, a year in the form YY- ddd to the form YYYYddd. Arg-2, when added to the current year (at the time the program executes), defines the ending year of a 100- year interval. This interval is used to determine to what century the two-digit year in arg-1 belongs. Format: FUNCTION DAY-TO-YYYYDDD ( arg-1 [ arg-2 ] ) Arguments: 1. arg-1 must be a nonnegative integer between 0 and 99999. 2. arg-2 must be an integer. If it is omitted, the default value is 50. 3. arg-2, when added to the current year, must be between 1700 and 9999. Returned Value: The returned value is an integer representing YYYYddd and is cal- culated as follows: YY = int(arg-1 / 1000) ddd = mod (arg-1, 1000) return FUNCTION YEAR-TO-YYYY(YY, arg-2) * 1000 + ddd Examples: IF FUNCTION DAY-TO-YYYYDDD (80111, 50 ) = 1980111 DISPLAY "correct". IF FUNCTION DAY-TO-YYYYDDD (80111, 100 ) = 2080111 DISPLAY "correct". IF FUNCTION DAY-TO-YYYYDDD (80111, -100 ) = 1880111 DISPLAY "correct". Note: DAY-TO-YYYYDDD implements a sliding window algorithm. To use it for a fixed window, arg-2 can be specified as follows: (fixed-ending-year - function numval (function current-date (1:4))) If fixed-ending-year was 2100, then in 1999 arg-2 will have the value 101. If arg-1 was 50111, the returned-value would be 2050111. If arg-1 was 99111, the returned-value would be 2099111. 40 Compaq COBOL V2.6 Release Notes TEST-DATE-YYYYMMDD Description: The function TEST-DATE-YYYYMMDD tests if a standard date in the form YYYYMMDD is a valid date in the Gregorian calendar. Format: FUNCTION TEST-DATE-YYYYMMDD ( arg-1 ) Arguments: 1. arg-1 must be an integer. Returned Value: If the year is not within the range 1601 through 9999, the func- tion returns a 1. Otherwise, if the month is not within the range 1 through 12 the function returns a 2. Otherwise, if the number of days is invalid for the given month, the function returns a 3. Otherwise, the function returns a 0 to indicate the date is a valid date in the form YYYYMMDD. Examples: IF FUNCTION TEST-DATE-YYYYMMDD (123456789) = 1 DISPLAY "correct - invalid year (12345)". IF FUNCTION TEST-DATE-YYYYMMDD (19952020) = 2 DISPLAY "correct - invalid mm (20)". IF FUNCTION TEST-DATE-YYYYMMDD (19950229) = 3 DISPLAY "correct - invalid dd (29)". IF FUNCTION TEST-DATE-YYYYMMDD (20040229) = 0 DISPLAY "correct - valid YYYYmmdd". Compaq COBOL V2.6 Release Notes 41 TEST-DAY-YYYYDDD Description: The function TEST-DAY-YYYYDDD tests if a Julian date in the form YYYYDDD is a valid date in the Gregorian calendar. Format: FUNCTION TEST-DAY-YYYYDDD ( arg-1 ) Arguments: 1. arg-1 must be an integer. Returned Value: If the year is not within the range 1601 through 9999, the func- tion returns a 1. Otherwise, if the number of days is invalid for the given year, the function returns a 2. Otherwise, the function returns a 0 to indicate the date is a valid date in the form YYYYddd. Examples: IF FUNCTION TEST-DAY-YYYYDDD (12345678) = 1 DISPLAY "correct - invalid year (12345)". IF FUNCTION TEST-DAY-YYYYDDD (1995366) = 2 DISPLAY "correct - invalid ddd (366)". IF FUNCTION TEST-DAY-YYYYDDD (2004366) = 0 DISPLAY "correct - valid YYYYddd". 42 Compaq COBOL V2.6 Release Notes 5.1.2 Example - cobfunc, cobcall, cobcancel Section 12.6 of the User Manual "Calling DIGITAL COBOL Programs from Other Languages" needs clarification about the values returned by cob- call and cobfunc. cobcall and cobfunc can return a signed integer value from the GIVING clause of the COBOL program whose value is a longword integer (for example, PIC S9(9) COMP). The results of returning other values from the program called by cobcall or cobfunc are undefined. Following is an example of the use of cobcall/cobfunc/cobcancel in a C program that uses cobcall, cobfunc, and cobcancel to call or can- cel another COBOL program. Here is progc.c, the C program that calls the COBOL program: /* File: progc.c */ #include "stdlib.h" #include "stdio.h" /* printf */ #include "string.h" /* strlen */ #define NUMARGS 4 /* up to 254 allowed */ void cobcancel(char *name); int cobcall (char *name, int argc, char **argv); int cobfunc (char *name, int argc, char **argv); void display(char *s, int r, int a); extern int progcob(); /* COBOL returns int */ void mainx(){ int retval = 0; /* progcob returns int */ char *a_list[NUMARGS]; /* progcob needs 4 args */ int arg1 = 1, arg2 = 2, arg3 = 3, arg4 = 4; a_list[0] = (char *) &arg1; /* address of 1st arg */ a_list[1] = (char *) &arg2; /* address of 2nd arg */ a_list[2] = (char *) &arg3; /* address of 3rd arg */ a_list[3] = (char *) &arg4; /* address of 4th arg */ display("[0] All the initialized values", retval, arg1); retval = cobcall("progcob", NUMARGS, a_list); display("[1] After calling cobcall:", retval, arg1); retval = cobfunc("progcob", NUMARGS, a_list); display("[2] After calling cobfunc:", retval, arg1); retval = cobcall("progcob", NUMARGS, a_list); display("[3] After calling cobcall again:", retval, arg1); cobcancel("progcob"); display("[4] After calling cobcancel:", retval, arg1); retval = cobcall("progcob", NUMARGS, a_list); display("[5] After calling cobcall again:", retval, arg1); } Compaq COBOL V2.6 Release Notes 43 void display(char *s, int r, int a){ unsigned int i = 0; printf("\n%s\n", s); for (i = 0; i < strlen(s); i++) printf("="); printf("\n retval = %d", r); printf("\n arg1 = %d", a); printf("\n"); } Here is progcob.cob, the COBOL program that is called by the C pro- gram: identification division. * File progcob.cob ************************************************************** * The C program calls this COBOL program with four arguments: * arg1, arg2, arg3, arg4. * * This program performs: * arg1, myVal get the value of arg1 + arg2 + arg3 + arg4 * * When cobfunc or cobcancel is called the values in * working-storage are reset to their initial values. * * retVal: to demonstrate the value returned by this program. * myVal : to demonstrate cobcancel in the C program * arg1 : to demonstrate cobcall and cobfunc in the C program. ************************************************************** program-id. progcob. data division. working-storage section. 01 retVal pic 9(9) comp value 987654321. 01 myVal pic 9(9) comp value 0. linkage section. 01 arg1 pic 9(9) comp value 0. 01 arg2 pic 9(9) comp value 0. 01 arg3 pic 9(9) comp value 0. 01 arg4 pic 9(9) comp value 0. procedure division using arg1 arg2 arg3 arg4 giving retVal. p0. display " +------------------- From COBOL --------------------". display " | myVal = " myVal with conversion. display " | arg1 = " arg1 with conversion. display " | arg2 = " arg2 with conversion. display " | arg3 = " arg3 with conversion. display " | arg4 = " arg4 with conversion. display " | retVal = " retVal with conversion. add arg1 arg2 arg3 arg4 giving arg1 myVal. 44 Compaq COBOL V2.6 Release Notes display " + After 'add arg1 arg2 arg3 arg4 giving arg1 myVal':". display " | myVal = " myVal with conversion. display " | arg1 = " arg1 with conversion. display " | arg2 = " arg2 with conversion. display " | arg3 = " arg3 with conversion. display " | arg4 = " arg4 with conversion. display " | retVal = " retVal with conversion. display " +---------------------------------------------------". end program progcob. There are two things to be noticed here. First, the C program progc.c does not have a function called main. The function name "main" has to be renamed, because the COBOL RTL already contains a symbol called main on Windows NT Alpha. To resolve this, we call progc.c from a dummy COBOL program called progmain.cob. On Tru64 UNIX, if a COBOL routine is not the main program, you need to call cob_ init. Here is progmain.cob: identification division. * file progmain.cob program-id. progmain. procedure division. s1. call "mainx". stop run. end program progmain. Second, the return value from the COBOL program is an int. Therefore, it is customary to use int data type for the variables in C and COBOL programs that are passed back and forth. For example, retval, arg1, arg2, arg3, and arg4 are declared as int and pic(9) in the C and COBOL program, respectively. Here are the commands to compile, link and run on different platforms: [OpenVMS] $ cobol PROGMAIN.COB, PROGCOB.COB $ cc PROGC.C $ link PROGMAIN.OBJ +PROGCOB.OBJ +PROGC.OBJ (*) $ run PROGMAIN.EXE [UNIX] % cobol progmain.cob progcob.cob progc.c (*) % a.out [Windows NT] c:\> cobol -c progmain.cob progcob.cob c:\> cl -c progc.c c:\> cobol progmain.obj progcob.obj progc.obj (*) c:\> progmain Note that the order of listing at (*) is fundamental. Now here is a sample run: Compaq COBOL V2.6 Release Notes 45 [0] All the initialized values ============================== retval = 0 arg1 = 1 +------------------- From COBOL -------------------- | myVal = 0 | arg1 = 1 | arg2 = 2 | arg3 = 3 | arg4 = 4 | retVal = 987654321 + After 'add arg1 arg2 arg3 arg4 giving arg1 myVal': | myVal = 10 | arg1 = 10 | arg2 = 2 | arg3 = 3 | arg4 = 4 | retVal = 987654321 +--------------------------------------------------- [1] After calling cobcall: ========================== retval = 987654321 arg1 = 10 +------------------- From COBOL -------------------- | myVal = 10 | arg1 = 10 | arg2 = 2 | arg3 = 3 | arg4 = 4 | retVal = 987654321 + After 'add arg1 arg2 arg3 arg4 giving arg1 myVal': | myVal = 19 | arg1 = 19 | arg2 = 2 | arg3 = 3 | arg4 = 4 | retVal = 987654321 +--------------------------------------------------- [2] After calling cobfunc: ========================== retval = 987654321 arg1 = 19 +------------------- From COBOL -------------------- | myVal = 0 | arg1 = 19 | arg2 = 2 | arg3 = 3 | arg4 = 4 | retVal = 987654321 + After 'add arg1 arg2 arg3 arg4 giving arg1 myVal': | myVal = 28 | arg1 = 28 | arg2 = 2 46 Compaq COBOL V2.6 Release Notes | arg3 = 3 | arg4 = 4 | retVal = 987654321 +--------------------------------------------------- [3] After calling cobcall again: ================================ retval = 987654321 arg1 = 28 [4] After calling cobcancel: ============================ retval = 987654321 arg1 = 28 +------------------- From COBOL -------------------- | myVal = 0 | arg1 = 28 | arg2 = 2 | arg3 = 3 | arg4 = 4 | retVal = 987654321 + After 'add arg1 arg2 arg3 arg4 giving arg1 myVal': | myVal = 37 | arg1 = 37 | arg2 = 2 | arg3 = 3 | arg4 = 4 | retVal = 987654321 +--------------------------------------------------- [5] After calling cobcall again: ================================ retval = 987654321 arg1 = 37 5.2 [Windows NT] Adobe Acrobat Reader Information required to use Compaq COBOL on Windows NT Alpha is lo- cated in the hardcopy user manual. In addition to this book, we have provided the user manual in an Adobe Acrobat Portable Document For- mat (PDF) file. Technical reference material about Compaq COBOL is pro- vided in a separate PDF file, the DIGITAL COBOL Online Reference. The Acrobat Reader provides you with the ability to read all Compaq COBOL documentation online while you are programming. With this reader you can: o View pages in a variety of ways to find the most comfortable read- ing size and format o Cut and paste o Print a selected range, a page, a selected range of pages, or the entire manual o Easily access information in a related publication through direct links Compaq COBOL V2.6 Release Notes 47 o Perform online searches as well as navigate easily with the table of contents bookmarks When you use the Acrobat Reader, most of the time your mouse cursor resembles a hand. Whenever the hand turns into a pointing finger, a mouse click takes you directly to the referenced information, whether it is in the manual file you have open or in another file. When you click on a Bookmark, the Reader jumps to the appropriate page. Arrowheads in the list of Bookmarks show where there is an additional level of detail available. Click on a right-pointing arrowhead to ex- pand the pointer to show an additional level of detail. If you do not have a version of Adobe Acrobat Reader available, the Compaq COBOL kit includes one that you may install. If you choose to install it, you will also need to have FX!32 V1.3 on your system. If you do not have that version of FX!32, the Compaq COBOL kit includes it so you can to install it. FX!32 V1.3 requires Windows NT Alpha 4.0 SP3 or SP4. See the Installation chapter in the DIGITAL COBOL User Man- ual for Windows NT Alpha for more information. 48 Compaq COBOL V2.6 Release Notes 5.3 Summary of the Compaq COBOL Documentation Set Depending on how you order the final product, you may receive printed copies of the following Compaq COBOL manuals. The order numbers for the manuals are listed in Read Before Installing Compaq COBOL V2.6. o DIGITAL COBOL Multiplatform Overview & Compatibility Guide Describes the compatibility features of the Compaq COBOL products across the four supported platforms. o DIGITAL COBOL Reference Manual (Unchanged for Version 2.6) Describes the source language environment for the Compaq COBOL pro- grammer. Defines the format and use of statements in the Compaq COBOL language. This document highlights extensions to the 1985 ANSI COBOL Standard by color in the printed document and by shading in the syn- tax diagrams for Bookreader. o DIGITAL COBOL User Manual (Unchanged for Version 2.6) Describes the development and run-time environment for the Compaq COBOL programmer working on OpenVMS Alpha or Tru64 UNIX. Describes the commands to compile, link, run, and debug COBOL pro- grams. It also explains Compaq COBOL I/O, the language interface with the calling standard, error handling and run-time messages, using struc- tures and records, writing a condition handler, native data char- acteristics, using nonnative numeric formats, compatibility issues with Compaq COBOL for OpenVMS VAX, and using CDD/Repository, LSE, SCA, FUSE, and the debuggers. o DIGITAL COBOL User Manual for Windows NT Alpha (Unchanged for Ver- sion 2.6) Describes the development and run-time environment for the Compaq COBOL programmer working on Windows NT Alpha. o Compaq COBOL Online Help file The online Help file presents information on the Compaq COBOL com- mand qualifiers and options. [OpenVMS] Presents the COBOL general formats and describes the data items. Describes a subset of the compiler messages and the complete set of run-time messages. o Compaq COBOL for OpenVMS Alpha Systems Installation Guide Explains how to install Compaq COBOL V2.6 and subsequent point re- leases on OpenVMS Alpha, including registering a license PAK (prod- uct authorization key), disk space, and other prerequisites. This installation guide is provided in PostScript form (.PS file type) and in plain ASCII form (.TXT file type) on the Layered Prod- ucts Media CD. o Compaq COBOL for Tru64 UNIX Systems Installation Guide Compaq COBOL V2.6 Release Notes 49 Explains how to install Compaq COBOL V2.6 and subsequent point re- leases on Tru64 UNIX, including registering a license PAK (prod- uct authorization key), disk space, and other prerequisites. This installation guide is provided in PostScript form (.PS file type) and in plain ASCII form (.TXT file type) on the Layered Prod- ucts Media CD. o DIGITAL COBOL DBMS Database Programming (Unchanged for Version 2.6) Describes how to use language elements specific to DBMS database programming on OpenVMS Alpha. This book is an adjunct to the Compaq COBOL basic doc set. We have collected the elements specific to Oracle DBMS database program- ming, and concentrated them in this optional book for the conve- nience of programmers who write COBOL programs that access Oracle DBMS databases. You can order these documents in printed form from Compaq as an en- tire kit or individually. 5.4 Feedback on Our Documentation Compaq appreciates your comments. If you would like to comment about the Compaq COBOL documentation, or if you find errors in any part of it, please send the manual title, order number, and your comments by one of the following methods: o Your PTR account o Electronic Internet mail: cobol_docs@bookie.enet.dec.com o FAX: 603-884-0120 Attn: Languages Documentation, ZKO2-3/K35 o A letter sent to the following address: Compaq Computer Corporation Languages Documentation, ZKO2-3/K35 110 Spit Brook Road Nashua, NH 03062-2698 USA 50 Compaq COBOL V2.6 Release Notes 6 Troubleshooting Tips If your program is not working as expected, here are some things to do: o If you have Compaq COBOL for OpenVMS VAX, try /STANDARD=OPENVMS_ AXP. o Try /NOOPT (-O0). /OPT (-O) and /NOOPT (-O0) are intended to pro- duce the same results (probably with different compile-time and run- time performance), but you may be able to eliminate a problem by compiling /NOOPT (-O0). Please report any differences you find with any level of optimization. o Try /CHECK (-check). The various /CHECK (-check) options can help you find some coding errors at run time. o Try /WARNINGS=ALL (-warn all). The various warnings might help iden- tify possible areas of the program to be investigated as potential sources of a problem. Compaq COBOL includes an informational diagnostic to help identify arithmetic statements that may get different results from other COBOL compilers. The INTERMED diagnostic has the text: Possible truncation due to use of intermediate data item This indicates an expression for which Compaq COBOL introduces a floating point or COBOL Intermediate Temp intermediate data type. This diagnostic identifies places where binary or decimal floating- point arithmetic is being used instead of fixed-point arithmetic for intermediate computations. This can lead to unexpected final results and possibly results different from Compaq COBOL for Open- VMS VAX. A statement that triggers this diagnostic should be ex- amined. One option is to compile with [OpenVMS] COBOL /MATH_INTERMEDIATE=CIT4 [UNIX] cobol -math_intermediate cit4 [Windows NT] COBOL /MATH_INTERMEDIATE=CIT4 See section 2.2 for additional details on CIT4. Another option is to rewrite the expression using two or more sim- pler statements. If you know the intended ranges of values for the input operands, you can specify the precision of intermediates, re- sulting in expression evaluation that can be accomplished using fixed- point arithmetic. o If the program is using a file created on a VAX and you compiled the program on Alpha using /ALIGNMENT or /ALIGNMENT=PADDING, try /NOALIGNMENT (the default for Compaq COBOL). o There are two diagnostic tools to help acquire information on how to proceed with correcting alignment mismatches between a Compaq COBOL program and another program when they are sharing a record structure such as a file record structure: - /NOALIGNMENT/WARNINGS=ALL - /MAP=DECLARED/LIST Compaq COBOL V2.6 Release Notes 51 With /NOALIGNMENT/WARNINGS=ALL, you will receive warnings for all data whose allocation will change if /ALIGNMENT is used. This in- formation can be used with the listing produced with /MAP=DECLARED /LIST to determine which records might need to be differently aligned to be compatible with other programs that will be sharing files based on these records. There are two options for utilizing Alpha Natural Alignment and Padding for record formats: - /ALIGNMENT[=PADDING] - Alignment directives The alignment directives allow you to set different alignment op- tions for different records within the program's source file. o If you are having trouble reading a SEQUENTIAL or RELATIVE file cre- ated on OpenVMS, try moving the file to Windows NT Alpha or Com- paq Tru64 UNIX using FTP binary mode or ZIP. In addition, for REL- ATIVE files, you must specify no compression using the -0 option. If the file on OpenVMS is in VFC format (for example, a file cre- ated with EXTERNAL or Report Writer or LINAGE on OpenVMS), you will need to skip over the VFC bytes when you read the file on Windows NT Alpha or Compaq Tru64 UNIX. Another option with Compaq COBOL on OpenVMS Alpha is to suppress the use of VFC with /NOVFC. o For Indexed files on OpenVMS, a key defined in the file but not the program is not considered a mismatch, and /CHECK=DUPLICATE_KEYS only considers this a mismatch if the key is declared both in the file and the program, and differs with respect to whether duplicates are allowed. For Compaq COBOL on Tru64 UNIX, without -relax_key_checking or Windows NT Alpha without /RELAX_KEY_CHECKING, a missing key is always considered a mismatch, and with -relax_key_checking, it is not considered a mismatch for the keys to differ with respect to duplicates. In other words, to get consistent behavior with respect to duplicate key checking for all three supported platforms, spec- ify all the keys in both the file and the program. o If the program is attempting to read multiple files from a tape, use OPEN WITH NOREWIND to get consistent results between Compaq COBOL for OpenVMS VAX and Compaq COBOL. o If the program is compiled /STANDARD=V3 (-std v3), make sure that the program does not depend on the Compaq COBOL for OpenVMS VAX /STANDARD=V3 features that are not supported by Compaq COBOL on Al- pha. These features can result in different behavior in the fol- lowing situations: - When subscripts are evaluated in STRING, UNSTRING, and INSPECT (Format 3) statements and the REMAINDER phrase of the DIVIDE state- ment - When reference modification is evaluated in STRING, UNSTRING, and INSPECT (Format 3) statements - When the variable associated with the VARYING phrase is augmented in PERFORM... VARYING... AFTER statements (Format 4) 52 Compaq COBOL V2.6 Release Notes - How PIC P digits are interpreted in some moves - When the size of variable-length tables is determined /WARNINGS=ALL can help you determine the effects of /STANDARD=V3. For full information on the Compaq COBOL for OpenVMS VAX implemen- tation of /STANDARD=V3, see Appendix B in the DIGITAL COBOL User Manual for Windows NT Alpha and the appendix on qualifiers in the VAX COBOL User Manual. In addition, FILE STATUS 02 with /STANDARD=V3 is handled differ- ently between Compaq COBOL for OpenVMS VAX and Compaq COBOL. With Compaq COBOL for OpenVMS VAX, if a record with a duplicate alter- nate key is written, FILE STATUS 02 is set and the DECLARATIVES pro- cedure executes. With Compaq COBOL, FILE STATUS 02 is set, but the DECLARATIVES procedure does not execute. o If the program is calling or called by another module (whether the other module is written in COBOL or another language), make sure the other module is compiled using compatible alignment and float- ing point types for any arguments passed in the calls. For example, if a C module is compiled with the C equivalent of /NOALIGNMENT (the Compaq COBOL default) that is, "#pragma nomem- ber_alignment", then a Compaq COBOL module that calls or is called by that C module should be compiled /NOALIGNMENT. The Compaq C de- fault is MEMBER_ALIGNMENT. For compatibility with Compaq C's "#pragma member_alignment", use /ALIGNMENT=PADDING or *DC SET PADALIGN. o If you encounter a problem possibly related to reserved words, use - /RESERVED_WORDS=NOXOPEN This allows use of the X/Open reserved words as though they were not reserved words. o When you compile a program with debugging also specify /NOOPTIMIZE to expedite your debugging session. Note that DEBUG sets -g2 -O0 with Compaq COBOL on Tru64 UNIX and Windows NT Alpha. Optimization often changes the order of execution of statements in a program, and it may keep values in registers and deallocate user variables. These effects can be confusing when you use the debugger. On Open- VMS Alpha, a diagnostic message warns you if you compile a Compaq COBOL program /DEBUG without specifying anything about optimiza- tion on the command line. o If you are running out of virtual memory during compilation, try compiling /NOOPT and increasing virtual memory using the guidelines in the User Manual. Not all programs can be compiled with all op- timization levels for a given virtual memory configuration. Some programs may not even compile /NOOPT. In those cases, you will need to reduce the program size per module by reducing the number of ex- ecutable statements in each module and/or by reducing the size of data structures in each module. Compaq COBOL V2.6 Release Notes 53 o With extended ACCEPT/DISPLAY, Compaq COBOL for OpenVMS VAX and Com- paq COBOL may use different escape sequences to update the screen. Also, the screen update behavior is not identical between the prod- ucts. o [Windows NT] VT100-compatible control sequences are not supported. o If you attempt to use extended ACCEPT/DISPLAY with input redirected from a file and/or output redirected to a file, the operation be- tween Compaq COBOL for OpenVMS VAX and Compaq COBOL is not iden- tical. In general, the Compaq COBOL RTL attempts to use ANSI AC- CEPT/DISPLAY to handle all ACCEPT/DISPLAYs in this situation. For example, if you use DISPLAY AT LINE or ACCEPT DEFAULT, the Compaq COBOL RTL will ignore the extensions (that is, LINE or DEFAULT) if you redirect output to a file and/or input from a file. o There are various things to consider related to floating point (COMP- 1, COMP-2) support. Compaq COBOL supports IEEE floating point on all Alpha platforms. In addition, on OpenVMS Alpha, Compaq COBOL supports F, D, and G floating. Compaq COBOL for OpenVMS VAX sup- ports VAX F and VAX D floating. VAX D is not equivalent to the D float available on Alpha. See the DIGITAL COBOL User Manual for Win- dows NT Alpha for additional details on floating point support. Floating point results should not be tested for exact equality or inequality; many decimal values containing fractional digits can- not be represented exactly in binary floating point. Instead of test- ing that the value exactly equals (or does not equal) the expected result, test that the value is within some small range of the ex- pected result. o Invalid decimal data checking with /CHECK=DECIMAL in Compaq COBOL is not 100% compatible with Compaq COBOL for OpenVMS VAX's use of the VAX instructions to do invalid decimal data checking. o [OpenVMS] If the LINK of a COBOL program fails with any DCOB$ un- defined symbols, it is possible that COBOLRTL026 has not been in- stalled. o [OpenVMS] If the program uses floating point data from a file cre- ated on an OpenVMS VAX system with Compaq COBOL for OpenVMS VAX, try /FLOAT=D_FLOAT. o [OpenVMS] If a file is accessed that contains G-float data, use /FLOAT=G_FLOAT; if the file contains IEEE-float data, use /FLOAT=IEEE_ FLOAT. o [OpenVMS] If you are using Compaq C on OpenVMS Alpha, use $ CC/STANDARD=VAXC/FLOAT=D_FLOAT or $ COBOL/FLOAT=G_FLOAT The default for Compaq C on OpenVMS Alpha is /FLOAT=G_FLOAT, while the default for Compaq COBOL is /FLOAT=D_FLOAT. Other languages such as Compaq Pascal also have /FLOAT=G_FLOAT as the default. o [OpenVMS] If you get the following at run time %IMGACT-F-SYMVECMIS, shareable image's symbol vector table mismatch -IMGACT-F-FIXUPERR, error when PR_JP referenced DEC$COBRTL 54 Compaq COBOL V2.6 Release Notes this may indicate that you have upgraded the operating system ver- sion, but you have not reinstalled Compaq COBOL, specifically COBOLRTL026. o [OpenVMS] If you are using /NATIONALITY=JAPAN, and you get the fol- lowing at run time %COB-F-BUG_CHECK, internal consistency check failure make sure you have /NATIONALITY=JAPAN support in the DEC$COBRTL.EXE you are using (that is, V2.3 or higher). o [OpenVMS] On OpenVMS Alpha systems, if your application uses any of the following character attribute clauses with ACCEPT or DIS- PLAY statements: - BOLD or HIGHLIGHT - BLINKING or BLINK - UNDERLINED or UNDERLINE - REVERSED or REVERSE-VIDEO you may find that the screen scrolls unexpectedly when the termi- nal is in wrap mode and Compaq COBOL displays data in the lower right corner of the screen. This behavior occurs when the data being displayed fits on the bot- tom line, but the control sequences which turn off the character attributes (and which Compaq COBOL appends to the data), extend past the end of the line. The unexpected scrolling is caused by the Open- VMS Alpha terminal driver because it interprets the control sequences as normal data and performs wrapping when it reaches the end of the line. Screen scrolling may also occur if your application displays es- cape sequences when the cursor is in the lower right corner of the screen. Setting the terminal to nowrap mode will solve this prob- lem, or you can adjust the cursor's position prior to displaying the escape sequence. One solution to this problem is to set the terminal to nowrap mode using $ SET TERMINAL/NOWRAP If this is not an acceptable solution, adjust the placement and/or size of the item being accepted or displayed. [UNIX] If your program gets the following failure during load: a.out /sbin/loader: Fatal Error: object libcurses.so from liblist in a.out has version "osf.1", which does not match the found object: /usr/shlib/libcurses.so (with version "xpg4") the program was built -call_shared (the default) with DIGITAL COBOL V2.5 or earlier and the file /usr/shlib/osf.1/libcurses.so. is not installed on your system. Compaq COBOL V2.6 Release Notes 55 If you rebuild your program with Compaq COBOL V2.6, you do not need this file. If you wish to run your programs with the Compaq COBOL RTL V2.6 without rebuilding the program, this file can be installed from the optional subset OSFOBSOLETE supplied with your Tru64 UNIX installation kit. o [UNIX] If your program gets the following ld failure: ld: /sbin/loader: Error: unresolvable symbol in /usr/shlib/libcob.so: _cobol_main You must call cob_init from your main C program. See the DIGITAL COBOL User Manual p. 12-22, Interprogram Communication for addi- tional details. o [UNIX] If your program is not linking correctly on Compaq Tru64 UNIX and (for example) you get the following error: ld: Can't locate file for : -lcurses cobol: Severe: Failed while trying to link This is usually an indication of an installation problem. Compaq COBOL requires that the OSFPGMR subset be installed. To see if the OSFPGMR subset is installed use the following com- mand: /usr/sbin/setld -i | grep OSFPGMR o [UNIX, Windows NT] If you get an unexpected "file not found" er- ror at run time, there are several things to check: - Make sure the file specification in the ASSIGN TO and VALUE OF ID clauses match exactly (no leading/trailing blanks, and so forth) the pathname you are trying to access. For Tru64 UNIX, also make sure the file specification upper/lower case matches. - Make sure VALUE OF ID names are set up as environment variables if you had previously used VALUE OF ID to specify an OpenVMS log- ical name. - Make sure any file names with ".DAT" are explicitly specified with ".DAT" in the ASSIGN TO and VALUE OF ID clauses (Compaq COBOL for OpenVMS VAX and Compaq COBOL on OpenVMS Systems supply ".DAT" if no file extension is specified). - Make sure you are not trying to open an INDEXED file as you would with ORGANIZATION SEQUENTIAL or ORGANIZATION RELATIVE. o [UNIX, Windows NT] If you get an unexpected "indexed keys do not match" error at run time, make sure that you have specified all the keys just as they were specified when the file was created. Consider the use of -rkc (/RELAX_KEY_CHECKING) if you want to spec- ify fewer DISPLAY (PIC X) keys than when the file was created or change the use of DUPLICATES for one of the keys. o [UNIX, Windows NT] F, D, and G floating are not supported on Com- paq Tru64 UNIX and Windows NT. 56 Compaq COBOL V2.6 Release Notes o [Windows NT] If you are trying to run a program from OpenVMS and the file specifications in the ASSIGN clause and/or VALUE OF ID clause contain an OpenVMS logical, the Compaq COBOL RTL will attempt to translate it to a Windows NT environment variable, so no source changes will be required. For example, if you use the following statement: SELECT PAYROLL-FILE ASSIGN TO "PAYDIR2:PAYFILE.DAT" on Windows NT Alpha you can define an environment variable to in- dicate the device and directory where PAYFILE.DAT resides as fol- lows: set PAYDIR2=c:\proj\pay\data2\ When the program is run, the resultant file specification for which the OPEN will be attempted is c:\proj\pay\data2\PAYFILE.DAT. If PAY- DIR2 is not defined as an environment variable, the results of the OPEN are undefined. o [Windows NT] If you get cobrtl: severe: access violation and you are using COBOL /LINK, make sure that all files which in- clude COBOL modules are specified before /LINK. o [Windows NT] If you are unable to cut and paste the Interactive Com- piler Driver command line to/from a DOS command window, do the fol- lowing: 1. Right mouse click on the title bar of the DOS command window 2. Select Properties 3. Select Quick Edit Mode Compaq COBOL V2.6 Release Notes 57 7 Compaq COBOL Compatibility Matrix Legend x = Available today N = Not supported P = Partial support ___________________________________________________________________ Formerly VAX Formerly DEC COBOL COBOL ________________________ Windows OpenVMS OpenVMS Tru64 NT VAX Alpha UNIX Alpha ___________________________________V5.6_____V2.6____V2.6_____V2.6__ ANSI-85/-89 HIGH x x x x ANSI-85 REPORT WRITER x x x x Tape handling x x x N Segmented keys x x x x /CHECK=DUPLICATE_KEYS x x N N Relaxed key checking N N x x RMS special registers x x N N RMS APPLY extensions x x N N /STANDARD=V3 x P P P ANSI-74 FILE STATUS support x x x x VFU x N N N Print control files with VFC x x N N Print control files without VFC N x x x ISAM READ PRIOR/START LESS N x x x Extended ACCEPT/DISPLAY x x x x ACCEPT/DISPLAY BLINK x x x N ACCEPT/DISPLAY WITH CONVERSION x x x x ACCEPT/DISPLAY VT52 support x N N N ACCEPT/DISPLAY VT{1,2,3,4}xx sup- x x x N port ACCEPT support for four-digit yearsx x x x New Y2K intrinsic functions x x x x File sharing / rec locking x x P P UCX/NFS support (nolocking) N N x x FUNCTION ARGCOUNT x x N N Little-endian COMP data x x x x 31-digit user items N x x x 18-digit intermediates x x x x 32-digit intermediates N x x x F,D floating x x N N G floating N x N N 58 Compaq COBOL V2.6 Release Notes ___________________________________________________________________ Formerly VAX Formerly DEC COBOL COBOL ________________________ Windows OpenVMS OpenVMS Tru64 NT VAX Alpha UNIX Alpha ___________________________________V5.6_____V2.6____V2.6_____V2.6__ IEEE S,T floating N x x x Floating point "E" literal x x x x 64-bit pointers N P x N SYS$CURRENCY x x N N Invalid decimal data checking P P P P X/Open RETURN-CODE N x x x X/Open COMP-5/COMP-X N x x x X/Open LINE SEQUENTIAL N x x x X/Open ASSIGN TO N x x x X/Open SCREEN SECTION N x x x X/Open SCREEN SECTION color N x x x X/Open SCREEN SECTION BLINK N x x N X/Open file sharing / rec locking N x x x X/Open environment variables N x x x X/Open command line N x x x /CHECK=(PERFORM,BOUNDS) x x x x VAX-compatible alignment x x x x Alpha natural alignment / padding N x x x /[NO]SEPARATE_COMPILATION P x N N I18N (PIC N, etc.) x x x x CALL USING BY DESCRIPTOR x x N N cobfunc, cobcall, and cobcancel N x x x Reformat x x x x Terminal source format x x x x Lowercase, -/_ in source x x x x IDENT x x N N Sample Application - Client/Server N N N x Sample Applications - Visual Basic N N N x calling COBOL Oracle CDD/DML support x x N N Transarc Encina (-tps) support N N x N DECset PCA,LSE/SCA support x x N N DECset PDF support x N N N FUSE support N N x N Interactive compiler driver N N N x Symbolic debugger support x x x x ___________________________________________________________________ Compaq COBOL V2.6 Release Notes 59 8 Providing Product Feedback If you have comments, suggestions, or questions about Compaq COBOL or Compaq COBOL for OpenVMS VAX, or if you are interested in signing up to field test a future version of Compaq COBOL or Compaq COBOL for Open- VMS VAX, send Internet mail to: cobol_ft@packed.enet.dec.com For general information about Compaq COBOL, check our web site at: http://www.openvms.digital.com/commercial/cobol We are interested in your feedback both on the capabilities of Com- paq COBOL V2.6 and on future capabilities you would like to see in Com- paq COBOL. When reporting a problem to Compaq, please supply as much of the fol- lowing information as you can: o Description of the problem o Version of the product o Version of the operating system and other related software o Sample source file which can be used to duplicate the problem o Run-time call stack from the debugger if you are reporting an ab- normal run-time termination o Command line used to produce the problem You can report problems via Internet mail, but use your regular Com- paq support channel if you are reporting a problem and you need a re- sponse back when the problem is resolved. 60 Compaq COBOL V2.6 Release Notes