This chapter describes what you need to do at the Fileshare Client and Fileshare Server machines to enable a standard COBOL program to use Fileshare. Once you have read this chapter, you should be able to configure any COBOL program to use Fileshare.
Note: In Mainframe Express, Fileshare is only supported for use by the components of Mainframe Express. Information in this chapter that describes using Fileshare in your own applications is not supported.
At the Fileshare Client machine, you need to do two things to enable your COBOL program to use Fileshare:
You might also need to configure CCI for the communications protocol you have chosen. For more details, please refer to:
If your program uses COBOL I/O syntax, you must compile your program with the CALLFH"FHREDIR" Compiler directive so that FHRedir processes any I/O requests that your program makes.
If your program uses the Micro Focus File Handler API, you need to change the program so that it calls "FHREDIR" and not "EXTFH". (The call interface to the FHRedir module is exactly the same as the call interface to ExtFH.)
call "FHREDIR" using operation-code, fcd
Having performed either of these steps (recompiling the program with CALLFH"FHREDIR" or calling FHRedir instead of ExtFH), you have created a Fileshare Client but your program works in exactly the same way as it did before because FHRedir simply forwards I/O requests to a local copy of the Micro Focus File Handler.
To use Fileshare, you need to configure your Fileshare Client to redirect the requests to a Fileshare Server.
The Fileshare Client configuration file is an ordinary text file that you can create using any text editor. By default, it is called fhredir.cfg. The Fileshare Client searches for this file in the current working directory of your application and then along the path specified by the COBDIR environment variable. Alternatively, you can specify the location of the Fileshare Client configuration file using the FHREDIR environment variable, for example:
This example tells the Fileshare Client to use the configuration file client.cfg in the root directory on drive c:.
This example tells the Fileshare Client to use the configuration file client.cfg in the root directory.
Configuring the Fileshare Client enables you to specify how you want to treat your data files, that is, as either:
In order to successfully redirect I/O operations, FHRedir needs to know:
Each Fileshare Server on the network is identified by a unique name, assigned when the Fileshare Server is started. The Fileshare Client uses this name to specify which Fileshare Server to use.
There are two ways to specify the Fileshare Server name:
Specifying the Fileshare Server as part of the filename in your program requires changes to your code while using a configuration file does not.
These methods are listed below in the order of priority the Fileshare Client uses when processing requests to a particular data file.
Specifying the server as a filename in your program overrides any configuration file settings.
select account-file assign to "$$server1\c:\accounts\main.dat"
This SELECT statement tells FHRedir to direct requests for this data file to the Fileshare Server named server1. The data file is main.dat in the directory accounts on drive c: on the Fileshare Server machine. FHRedir passes the characters appearing after the text string $$server1\ to the Fileshare Server as the name of the file.
select account-file assign to "$$server1//accounts/main.dat"
This SELECT statement tells FHRedir to direct requests for this data file to the Fileshare Server named server1. The data file is main.dat in the directory accounts on the Fileshare Server machine. FHRedir passes the characters appearing after the text string $$server1/ to the Fileshare Server as the name of the file.
To specify a default Fileshare Server, use the /s option in the Fileshare Client configuration file. For example:
tells the Fileshare Client to use the default Fileshare Server named server2. FHRedir redirects all file I/O to this server unless:
A Fileshare Client communicates with a Fileshare Server using the Common Communications Interface (CCI).
CCI supports several different communications protocols. The protocol you use depends on the operating system the Fileshare Client and Fileshare Server(s) are running on and the type of network you are using.
The default protocol is TCP/IP (CCITCP).
If a communications protocol other than the default is required, it must be specified in the Fileshare Client configuration file.
To specify an alternative default CCI protocol, use the /cm option:
This entry makes the Novell IPX protocol (CCIIPX) the default.
To specify that a particular CCI protocol is used when communicating with a specific Fileshare Server, use the /cm and /s options together:
/cm cciipx /s server1
This configuration file entry tells the Fileshare Client to use the Novell IPX protocol (CCIIPX) for communicating with the Fileshare Server named server1.
/cm ccitcp /cm cciipx /s server1
These configuration file entries tell the Fileshare Client to use the TCP/IP protocol (CCITCP) as the default and the Novell IPX protocol (CCIIPX) for communicating with the server named server1.
To configure CCI for your chosen protocol, please refer to your NetExpress online book, Configuring CCI.
You must start the Fileshare Server running before Fileshare Clients can connect to it. Invoke the Fileshare Server using the following command line:
Fileshare Server configuration options can be specified on the command line (separated by spaces), or in the Fileshare Server configuration file (a text file which you can create using any text editor).
The Fileshare Server determines the configuration file to use as follows:
Before a Fileshare Server is invoked, it needs to know:
Each Fileshare Server is identified on the network by a unique name. This name is specified using the /s option, for example, the command line:
fs /s server1
fs -s server1
registers the name of the Fileshare Server as server1.
Note: The Fileshare Server cannot be initialized unless it registers a name on the network. The server-name can be up to 16 characters in length, depending on the CCI protocol you are using.
You do not need to configure the communications protocol for the Fileshare Server unless a specific CCI protocol, other than the default, must be used. When no CCI protocol is specified, the default CCI protocol for the operating system of the machine that the Fileshare Server is running on is used. For Windows 95, Windows NT and UNIX the default protocol is TCP/IP (CCITCP).
You must specify all of the CCI protocols (apart from the default) that can be used by Fileshare Clients to contact this Fileshare Server. To do this, use the /cm option, for example:
this entry in the Fileshare Server configuration file tells the Fileshare Server that Fileshare Clients can communicate with it using the Novell IPX (CCIIPX) protocol.
these entries in the Fileshare Server configuration file tell the Fileshare Server that Fileshare Clients can communicate with it using TCP/IP (CCITCP) and the Named Pipes for UNIX (CCINAMPU) protocol.
Once started, a Fileshare Server runs as an active process until you explicitly stop it. You must stop the Fileshare Server when you no longer need it. To do this, press the Escape key. Fileshare displays:
FS097-I Are you sure that you wish to close down the Fileshare Server ?
Enter Y to confirm that you want Fileshare to terminate. Any other entry causes the Fileshare Server to continue running.
If any data files are still open, the following warning is displayed:
FS111-I Warning - files are still open Continue to close down the Fileshare Server (Y/N) ?
Enter Y to confirm that you want Fileshare to terminate. Fileshare automatically closes all data files and rolls back any outstanding transactions. Any other entry causes the Fileshare Server to continue running. This warning indicates one of the following:
If you are using the CCITCP protocol and the Fileshare Server terminates abnormally, you can restart the Fileshare Server using the same server-name. However, Fileshare displays the warning message:
FS153-I The Fileshare Server name has been reregistered on the network.
Copyright © 1998 Micro Focus Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.