Problem:
This document gives an overview of how to get started with the Micro Focus Fileshare product on a simple Network system using the TCP/IP protocol, which uses a single Fileshare server on which all data files reside. Applications run on several client machines and access and share the data files on the server through Fileshare. Both Windows and UNIX Fileshare configurations are covered. For a more detailed explanation of setting up and running CCI and Fileshare please refer to the Net Express manuals "Configuring CCI" and "Fileshare User's Guide".
Resolution:
This document will assume the following is true:
The Fileshare server name is fsserver1.
The hostname of the server machine is TESTFS and its dotted IP address is 127.0.0.1.
The appropriate Net Express or Server Express Application Server (run-time) files are installed on the client systems and on the Fileshare server. Please refer to your product documentation for a list of the files, which are necessary in order to deploy a Fileshare application.
Setup CCI (Common Communication Interface)
Check Network Connections
Fileshare uses the Micro Focus CCI product to handle the underlying communications.
Test TCP/IP connections using ping. Check for DNS name support as well as dotted IP address support. It is essential that the network connections be properly setup prior to installing Fileshare.
CCITCP2 Setup (see section on Direct Connection for alternative)
The CCITCP2 module keeps track of all registered Fileshare servers and will return the IP address and port number of a specified server to the Fileshare client. It needs to be loaded on at least one machine on the network. (unless you are using a direct connection).
Windows
Select the system on which CCITCP2.EXE should be run.
UNIX
Select the system on which ccitcp2 should be run.
In our example this is TESTFS.
Windows
Run the program CCIINST.EXE on each workstation. When prompted for a Server name enter either the TCP/IP host name or the dotted IP address of the machine on which you installed the CCITCP2.EXE program. In our example this is either TESTFS or 127.0.0.1. Instead on running CCIINST.EXE you can alternatively create an environment variable called CCITCP2 which can contain the address or name of the CCITCP2 server. If applications will also be run directly on the server machine then you should run the CCIINST.EXE program on the server as well. You can leave the name blank and it will default to the current host name.
UNIX
You must make the following entry in the /etc/services file:
mfcobol 86/udp
without this entry in the /etc/services file, CCITCP2 cannot function. You must then set the environment variable CCITCP2 to the hostname or the dotted IP address of the machine on which ccitcp2 will be run.
export CCITCP2=TESTFS
or
export CCITCP2=127.0.0.1
Windows
Start CCITCP2.EXE on the selected machine. It will be started in an MS-DOS Command Prompt window. It can then be minimized.
UNIX
Start ccitcp2 on the selected machine.
Direct CCITCP Connection Setup
If you know the hostname or dotted IP address of the server machine then you can set up a direct connection instead of using CCITCP2.
On the Server machine set the following environment variable:
CCITCPS_servername=MFPORT:nnnn
Where servername can be any name that you choose for your Fileshare server and nnnn can be any TCP/IP port number between 2000 and 65535 that is not being used.
Example:
Windows
SET CCITCPS_fsserver1=MFPORT:3000
UNIX
export CCITCPS_fsserver1=MFPORT:3000
On the Client machines set the following environment variable:
CCITCPT_servername=MFNODE:hostname,MFPORT:nnnn
Where servername should correspond to the same name specified on the server, hostname can be the hostname of the machine running the server or the dotted IP address and nnnn must correspond to the same port number that was specified on the server.
Example:
Windows
SET CCITCPT_fsserver1=MFNODE:127.0.0.1,MFPORT:3000
UNIX
export CCITCPT_fsserver1=MFNODE:127.0.0.1,MFPORT:3000
Setup Fileshare
Fileshare Application Program Setup
Add the compiler directive CALLFH"FHREDIR" to your program or project and rebuild your applications.
Also, add the LOCK MODE IS MANUAL WITH ROLLBACK to your files SELECT statement if you wish to use transaction processing.
Fileshare Client Setup
Create a Fileshare Client configuration file fhredir.cfg in the application program directory or in a location pointed to by the environment variable FHREDIR.
Example:
Windows
SET FHREDIR=c:\\fhredir.cfg
UNIX
export FHREDIR=/fhredir.cfg
tells Fileshare to look in the root directory for the configuration file named fhredir.cfg..
Options:
/s
Server Name to use
/cm
cci protocol to use (ccitcp, ccinetb, cciipx)
/f
filename for local access
Example fhredir.cfg:
Windows
/s fsserver1
/cm ccitcp
/f \\accounts\\payroll.dat
/f \\transport\\delivery\\*
UNIX
-s fsserver1
-cm ccitcp
-f /accounts/payroll.dat
-f /transport/delivery/*
This tells Fileshare to redirect all I-O requests to the server fsserver1 using TCP/IP for all files except those which are specified with the /f parameter. Files specified with the /f parameter are handled by the local file handler.
Fileshare Server Setup
Create a Fileshare Server configuration file fs.cfg in the directory from which Fileshare is started or in a directory specified within the COBDIR environment variable.
Options:
/s
Server Name
/d
Database reference file
/t
Timeout period
/m
Record size
/cm
cci protocol to use (ccitcp, ccinetb, cciipx)
/pf
Password File
/tr f
Activate trace option specifying a filename.
/wd
Working directory if started as NT Service
-b
Start as background process under UNIX only.
Example fs.cfg:
Windows
/s fsserver1
/cm ccitcp
/t 120
UNIX
-s fsserver1
-cm ccitcp
-t 120
Starting Fileshare
Start Fileshare by running the command FS. You can also pass the parameters in fs.cfg directly on the command line.
Example:
Windows
FS /s fsserver1 /cm ccitcp /t 120
UNIX
fs -s fsserver1 -cm ccitcp -t 120
If you wish to run Fileshare as a background process under UNIX please refer to Chapter 7 "Fileshare on UNIX", in the Fileshare User's Guide.
If you wish to run Fileshare as an NT Service please refer to Chapter 6 section 6.8 "Running Fileshare as a Windows NT Service" in the Fileshare User's Guide.
Mapping Filenames
If you are currently using Windows or NFS drive mappings to access your data files on a server machine then you may have to remove the reference to the drive letter or make use of the Fileshare "Filename Mapping" feature.
If your program specifies:
SELECT TEST-FILE ASSIGN TO "G:\\TEST.DAT"
Where the drive G: is mapped to the file server's C: drive.
This was valid when accessing the file directly through drive mapping and would result in the file TEST.DAT residing in the root directory of the file server which was mapped to the G: drive. When using Fileshare the name G:\\TEST.DAT would be passed to Fileshare running on the server and so the G: drive would not be valid when running from this machine. If the server machine had a different G: drive mapped to a different server then this is where Fileshare would look for the file. Where you really want Fileshare to look is in the root directory of C: on the server machine.
To map a filename or string within a filename to a different filename or string then use the following commands to create a database reference file on the system where Fileshare will be running.
Windows
fs /d dbase.ref /fs G:\\ /af C:\\
UNIX
fs -d dbase.ref -fs G:\\ -af /
This will create a database reference file named dbase.ref if it does not already exist and will add an entry to tell Fileshare to change all occurrences of the string "G:\\" within a filename to "C:\\". Then when you start Fileshare you need to reference the database reference file.
Windows
FS /s fsserver1 /cm ccitcp /t 120 /d dbase.ref
UNIX
fs -s fsserver1 -cm ccitcp -t 120 -d dbase.ref
All I-O requests for G:\\TEST.DAT will then be mapped to C:\\TEST.DAT.
For more information on this please refer to Chapter 6 section 6.2 "Filename Mapping" in the Fileshare User's Guide.
#RMCOBOL
#ServerExpress
#netexpress
#AcuCobol
#COBOL