Run-time Triggers, Configuration and Switches |
This chapter describes changes to the Micro Focus file handling systems that might affect the migration of applications to Server Express.
File handling errors that returned messages of the form 9/035, which you might have received on previous versions of COBOL for UNIX, are now returned as 9/037 instead.
You can specify that sequential files are multiple-reel files, which enables you to span files across media; for example, you could specify that a file is to be held on more than one removable disk.
If you specify that a sequential file is multiple-reel, you will be requested to load the appropriate reel; at the prompt, you must specify the appropriate device for that volume. However, previous versions of COBOL for UNIX incorrectly enabled you to enter a new name for the volume. If you have any batch programs, scripts, job-control, and so on, that make use of this erroneous operation of the prompt, you must modify them.
For details of using multiple-reel files, see the section Multiple-reel Files in the chapter Miscellaneous Topics in your File Handling book.
Server Express supports the External File Handler. For details of migration, refer to the section External File Handler in the chapter If You're Using... .
In earlier products, by using a name of the form &datafilename&indexfilename, you could place the index portion and data portion of an indexed file on different directories. For example, with a name such as &/disk1/data.dat&/disk2/data.idx, the data part of the file would be placed in /disk1/data.dat and the index part in /disk2/data.idx.
In the current product, this functionality is provided by means of the configuration options DATAFILE and INDEXFILE. You can specify these configuration options in the file handler configuration file extfh.cfg. For example, if the assignment name is data.dat, the above disposition of files can be achieved by placing the following in extfh.cfg:
[data.dat] datafile=/disk1/data.dat indexfile=/disk2/data.idx
On earlier products, if a file name set up in the COBOL program began with the '-' (hyphen) character, that character was dropped from the name used for the actual disk file. For example, if the file name set up by the COBOL program was -file.dat, the name of the file on disk would be file.dat.
This product retains the hyphen character in the filename of the file on disk. Therefore, in the example given above, the name of the file on disk would be -file.dat in this product.
Server Express provides two methods of filename mapping. You do not have to restrict yourself to using one or the other. The two methods are compatible.
With earlier products, and for some file types only, you could map filenames onto different names. To do this, you had to:
In Server Express, for this to still work you must also do one of the following:
In addition, Server Express provides the following method:
Note: Server Express begins by searching for the dd_ environment name. If this search is unsuccessful and you have employed Method 1, either by using ASSIGN(EXTERNAL) or by prefixing the name with $, Server Express looks for an environment variable name with the same name as the filename.
If the COBOL program has ASSIGN TO EXTERNAL DATFILE1:
If any of these environment variables are found, Server Express uses the value held in the environment variable as the actual file name. Otherwise the name DATFILE1 is used.
If the COBOL program has:
ASSIGN TO filename
and the data item filename
contains the value DATFILE2:
The file handler does not recognize the isam_open_key_check
run-time tunable. To get round this, set the configuration option KEYCHECK
to either ON or OFF, either globally or on a per-file basis. For more
information, see the section Configuration Options in the File
Handler Configuration chapter of the File Handling
book.
Even when you set KEYCHECK to OFF, the file handler still checks that the keys presented to it are a subset of the actual keys defined on the file. However, with KEYCHECK set to OFF, you do not have to define every key. For example, if you set KEYCHECK to OFF and the file has a prime key and 9 alternate keys, you can allow the file to be opened by specifying, say, only 5 of these alternate keys, provided that each of the keys specified is really a key for the file.
On earlier products, you could change the file filestat.c to provide alternative file status values. By default, the alternative file status values that filestat.c was able to provide were for RM/COBOL, although you could also define other file status values if you required.
On Server Express, the filestat.c file is no longer provided. If you want to change the file status values to emulate those returned by another COBOL product, you should set the CONVERTSTATUS option in the file handler configuration file. For information on configuring the file handler, see the File Handler Configuration chapter of your File Handling book.
On earlier products, if a program opened a data file for input, without using the sharing syntax in the SELECT clause (LOCK MODE IS AUTOMATIC or MANUAL), the file behaved as if sharing had been specified; that is, programs that did have sharing specified in their SELECT clause could also open the file for input-output operations and modify the file. In Server Express, the default behavior of the file handler has been changed so that this is no longer possible. By default, therefore, if a program opens a file for input (and that program has not specified that the file can be shared), other programs can open the file for input, but not for input-output.
If you want your applications to use the locking behavior that was available in the earlier products, set the file handler configuration parameter OPENINPUTSHARED to ON. However, this slows down access to the input file. You can minimize this performance degradation using the file handler configuration options:
IGNORELOCK=ON READSEMA=OFF
For details on the file handler configuration options see the File Handler Configuration chapter of your File Handling book.
On earlier products, you could set the K run-time switch to enable sequence-checking of keys in indexed files. The K switch has been removed from this version of the product. Compatibility with this switch is provided by the configuration option NOSEQCHECK. We do, however, strongly suggest that you control the order in which records are written to indexed files within the program itself, by using the ACCESS SEQUENTIAL or ACCESS DYNAMIC syntax, and avoid using the NOSEQCHECK configuration option.
In Server Express 2.0, the format of the File Control Description (FCD) has been changed from FCD2 to FCD3. Only FCD3 format can be used in 64-bit compilations. Both FCD2 and FCD3 format can be used in 32-bit compilations. To aid conversion of programs which use the FCD directly, you can use:
For more information, see the section File and FCD Handling in the chapter Creating 64-bit Programs in Programmer's Guide to Writing Programs.
Copyright © 2000 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.
Run-time Triggers, Configuration and Switches |