Problem:
filestat.c is missing from Server Express, how can file status values be customized.
Resolution:
The file named filestat.c file is not supplied in the Micro Focus Server Express product.
There is a new mechanism in the Server Express product which will allow file status values to be converted to any desired value(s). The steps needed to enable the conversion from Micro Focus standard file status codes to other values are:
Set the CONVERTSTATUS option in File Handler configuration file (extfh.cfg) for information on configuring the File Handler, see the chapter File Handler Configuration in File Handling documentation. The default filename for the File Handler configuration file is extfh.cfg however a different filename can be used and setting the EXTFH environment variable, for example: EXTFH=MYCONFIG.cfg
The CONVERTSTATUS option specifies the name of a program that is called after the File Handler has finished processing to map returned status values for emulation purposes. Three such programs are built into the product:
rmstat The rmstat program emulates status values returned by Ryan MacFarland COBOL.
hoststat The hoststat program emulates status values returned by IBM Mainframe COBOL compilers.
msstat The msstat program emulates status values returned by Microsoft COBOL V2
---Note: You can only use these programs if you compiled your program with the NOANS85 or the ANS85"SYNTAX" Compiler directive set.
-This option can be set globally only; that is under the tag [XFH-DEFAULT]. You cannot set the option for an individual file.
CONVERTSTATUS=program
In addition to the conversion of status for Standard dialects CONVERTSTATUS also allows for the use of user written conversion routines. Conversion routines are passed the File Control Descriptor (FCD) whenever an error occurs. The FCD is passed in the programs LINKAGE SECTION, and the program requires a PROCEDURE DIVISION USING DATANAME clause, where DATANAME is the name of a LINKAGE SECTION item that defines the FCD. The status fields in the FCD are the first two bytes of the structure. To convert the status values to something else simply alter these bytes and EXIT back to the application. Compile the status conversion routine so that it can be Dynamically loaded or create an object file that can be linked with a COBOL executable. An Example of a file status conversion routine is attached to this document.
Application must be compiled using the COBFSTATCONV compiler directive to enable status conversions.
The search order for the configuration file is:
a)The file specified by the EXTFH environment variable if set
b)COBDIR/etc/extfh.cfg
c)extfh.cfg in the current directory
The File Handler configuration file enables options to be set on a file by file basis, or for all files. Settings which apply to all files are listed under the tag: [XFHDEFAULT]
Create a text file named "extfh.cfg" and insert the following options specifications
[XFH-DEFAULT]
CONVERTSTATUS=hoststat
Put the configuration file into use by setting the EXTFH environment variable
EXTFH=/where/it/is/extfh.cfg
export EXTFH