Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
DOC File
Compatibility with Previous Releases of Microsoft(R) COBOL
(C) Copyright Microsoft Corporation, 1993
Contents
--------
Introduction
Changes in Microsoft COBOL 5.0
Changes in Microsoft COBOL 4.5
Changes in Microsoft COBOL 4.0
Documentation
Introduction
------------
This document is for use when maintaining applications created using
earlier releases of this product.
It describes the differences that may cause problems, and includes
documentation of features no longer documented in this system, but
maintained for compatibility.
Note that the use of the compiler with default settings will cause the
use of new words to become reserved. A list of these words is given
below.
IGNORE
KANJI
LOWER
NATIONAL
NATIONAL-EDITED
UPPER
WAIT
Running
o A large number of the run-time system subprogram calls, provided in
earlier releases as call-by-number calls, have been replaced by named
calls. In addition to making the calls easier to remember and use,
the call-by-name calls can accept parameters defined in any part of
the data division.
The replaced call-by-number calls are still supported in this
release, and documented below. However, we recommend that you
replace them with the equivalent call-by-name calls as appropriate.
o Record sizes
In previous releases, the maximum and minimum record sizes specified
for a variable format file had to be the same in every program
referencing the file. This restriction has been removed, allowing
programs to specify record lengths different to those specified in
the program used to create the file. However, if an attempt is made
to write a record which is smaller than the smallest defined or
larger than the largest defined a run-time error, 9/044, will be
returned.
Animating
o The method required to animate programs has changed in this release.
When a program is compiled for animation, using the ANIM directive,
intermediate code files are packaged into .OBJ files and .DLL on
OS/2). These .EXE/.DLL files can be animated in the usual way. The
pure intermediate code files (.INT) are no longer required for
animation.
o Since the new animation method incorporates a link step, any non-
COBOL .OBJ files can be linked in prior to animation. These will
operate correctly when encountered, though always in zoom mode. This
new technique makes IANIM and augmented INT obsolete, and these
facilities are not supported in this release.
The same method allows OS/2 API function calls to be resolved prior
to animation, avoiding the need for the Install Function technology
of earlier releases.
o This release has the +F switch set by default. This will cause
illegal data in numeric fields to be trapped during animation, and
when running intermediate code .OBJ files (run-time system error
163). This may cause existing programs to fail where they previously
worked. However, trapping such instances will help prevent the
subsequently generated code from failing. All generated programs will
work as at present, always assuming that numeric fields contain
numeric data.
Linking
o The linking library, OS2.LIB, should be used instead of DOSCALLS.LIB
when linking applications for use on OS/2(tm). OS2.LIB is supplied as
part of the utilities. (DOSCALLS.LIB can be used provided the
application is not a Presentation Manager application.)
o The /NOP option is no longer required when linking for use on OS/2.
o The default environment for applications created using this release
is the shared run-time environment. This is particularly recommended
for use on OS/2, where a single copy of COBLIB.DLL can be shared by
any COBOL application (built to use COBLIB) running in any OS/2
session.
To use this environment, the application is linked in the usual way,
using the libraries, COBLIB.LIB, and COBAPI.LIB or OS2.LIB depending
on DOS or OS/2. The EXE files produced will be much smaller since
little run-time system code is included directly. System programs,
such as EXTFH and ADIS, can be linked in with the application, or
linked as standalone sub-programs. Again, for OS/2, if linked as
standalone .DLL files, they can be shared by any number of COBOL
applications.
Notes:
- These system programs MUST be linked with COBLIB for use with
COBLIB applications.
- Modules linked with COBLIB cannot be mixed with modules linked
with LCOBOL. Hence, applications must be either all LCOBOL or all
COBLIB. However, COBLIB applications and LCOBOL applications can
be run on the same environment as long as they don't try to call
each other.
o The linking library (.LIB) files supplied with the system have been
split in a different way to enable reduced disk usage. They now
consist of LCOBOL.LIB, COBLIB.LIB, and COBAPI.LIB. The new LCOBOL
is equivalent to the old PCOBOL. The addition of COBAPI.LIB to
LCOBOL.LIB gives the old LCOBOL. (Users may like to recombine these
libraries using LIB if they wish to retain old working practices.)
For OS/2 operation, LCOBOL.LIB is used in combination with OS2.LIB
(which supersedes DOSCALLS.LIB).
In the shared run-time system, the default, COBLIB.LIB, is equivalent
to the old PRCOBOL.LIB. Again, either COBAPI.LIB or OS2.LIB is used
in combination with COBLIB.LIB to complete the linking for DOS or
OS/2 respectively. Applications linked with these libraries will be
very much smaller, benefiting from the shared run-time system support
in COBLIB.DLE and COBLIB.DLL. (Note that the application itself can
be bound so that it will run on both DOS and OS/2 provided both
shared run-time system files are present.)
o If you select a linking environment other than the built-in default,
SETUP will create a default LINKLIB in your COBOL.DIR. The default,
and equivalent of earlier releases, is LINKLIB(LCOBOL+COBAPI). If
you normally use the system on OS/2, use LINKLIB(LCOBOL+OS2). With
this release, the default is to use the COBLIB shared run-time system,
requiring LINKLIB(COBLIB+COBAPI) on DOS, and LINKLIB(COBLIB+OS2) on
OS/2.
When the default has been set in this way, you can still link for use
in other environments by specifying the relevant libraries on the
LINK command line. However, you should use the /NOD directive when
doing so, otherwise link-time errors may occur.
o The file handler for indexed files, IXSIO, has been replaced by the
external file handler, EXTFH. This can be linked in exactly the same
way as IXSIO in earlier releases, either linked in with the
application or linked as a standalone system program.
Programs referencing ANSI'85 EXTERNAL files and normal indexed files
now only use EXTFH rather than two separate file handlers.
Compatibility issues
Compiling
o If you compile your programs on OS/2 using batch files, you will need
to alter the batch files to compile using the command COBOL instead
of PCOBOL. Alternatively, you can copy COBOL.EXE to PCOBOL.EXE in the
COBOL system directory.
o Programs previously compiled without the ANS85 directive, if
recompiled under this default system, may not work correctly. The
most likely cause is that the new system has ANS85 on by default.
This causes all file status codes to be ANS85 not ANS74 statuses.
The problem can be avoided by using the NOANS85 directive when
compiling any program that is designed to work with ANS74 file
statuses.
Animating
o The compiler dictionary structure has been amended. This means that
IDY files created by earlier releases will not be compatible with
ANIMATOR in this system. Hence, you should recompile, with this
release of the compiler, any program you wish to animate.
Linking
o .OBJ files created by this release are not compatible with .OBJ files
created by earlier releases. Hence, if you need to rebuild an
application where one of the OBJs has been created using this
release, you must recompile all the programs with this release of the
compiler before linking.
Running
o In previous versions of this software, an error is given when an
indexed file is opened if the record lengths of the file do not
exactly match those given in the FD. This has been changed so the
error is only given if an attempt is made to WRITE a record larger
than the maximum or smaller than the minimum.
o The Report Writer module has been changed so that it is compatible
with IBM(R) OS/VS COBOL when the OSVS directive is used. This is the
ANSI'68 COBOL standard. In previous versions, the default with OSVS
was ANSI'74 COBOL standard report writer. You may have report writer
programs using OSVS features, but requiring ANSI'74 report writer
compatibility. This mix is no longer possible, and you will either
need to remove the OSVS features (try VSC2), or accept ANSI'68 COBOL
report writer standard.
Documentation
-------------
Call-by-number subprogram calls.
Many of the COBOL system library routines provided in earlier releases as
call-by-number have been replaced by call-by-name routines. We recommend
that you replace all call-by-number routines by their equivalent call-by-
name routines. See your Operating Guide chapter, COBOL System Library
Routines, for details of which call-by-name routines replace these.
To allow you to maintain existing applications, the documentation for the
replaced call-by-number routines follows:
PUT A CHARACTER TO THE SCREEN
CALL X"82" USING character.
where:
character is a PIC X field containing the character to be put on the
screen in the current cursor position.
The cursor is then advanced one position to the right, or onto the next
line if it is in the rightmost position, or off the screen if it is in
the bottom right-hand corner.
CLEAR SCREEN
CALL X"E4".
This routine clears the entire user screen.
==========================================================================
Copyright (C) 1993 Microsoft Corporation
Copyright (C) 1993 Micro Focus Ltd