This chapter describes various features and aspects of behavior that will often be useful when configuring an enterprise server to use Fileshare.
If a batch job needs exclusive access to a dataset that is also accessed by CICS, then the dataset must be closed and disabled before the batch job can run. The batch job waits until this has been done before executing.
If the batch job does not require exclusive access, there is no problem - it can access the dataset at the same time as CICS.
You can use the casfile command to close and disable a dataset, and to open and enable it again after the batch job has finished with it. You call casfile from the Net Express command prompt. You could call it indirectly from within a JCL jobstream, by writing a simple COBOL program to call it and then calling the COBOL program from the jobstream.
Here are some examples of casfile, showing its most important parameters. See casfile for full details.
To close and disable a file called payroll in an enterprise server called FSDEMO, enter:
casfile -rFSDEMO -oc -ed –dPAYROLL
Where:
To open and enable the same file, enter:
casfile -rFSDEMO -oo -ee –dPAYROLL
Where:
Note: This sets the status to open, but the file is not physically opened until it is first accessed.
You can call casfile from a COBOL program via x"91" function 35, CBL_EXEC_RUN_UNIT or simply by CALL "CASFILE" using ..., where the input consists of a string containing the options that you use on the command line prefixed with its length, as indicated below.
01 lk-cmd-line. 05 lk-cmd-len pic x(02) comp-x. 05 lk-cmd-data pic x(1024).
A return code of 0 indicates success. Any other value indicates an error.
If you move a number of datasets from one place on your PC or PC network to another - from one directory to another, from one network server to another, or from the control of one Fileshare server to another - you need to make sure each one's catalog entry shows the new path in the physical filename.
If the catalog and the datasets reside together on the same path, there is no problem. By default, paths in the catalog are stored as relative paths (although they are expanded before being displayed), so the relocation of the files is reflected automatically.
However, if the catalog resides in a different location to the data files, you must update the catalog entries. You can update them all in one command, using the utility mvspcrn.exe in a Net Express command prompt.
Before running the utility, you must set the environment variables:
In fact the value in MFALLOC_LOC is ignored, but it must be set. It's good practice to set it to the Default Allocated Dataset Location.
The format of the command line is:
mvspcrn old-string new-string
In each catalog entry where the physical filename (including path) starts with old-string, old-string is replaced by new-string.
The utility displays two prompts, asking you to confirm the setting of MFSYSCAT and the parameters, and then updates the catalog.
The parameters are case sensitive.
The utility does not actually move or rename any files. It only updates their catalog entries.
The utility affects entries for spool files as well as entries for cataloged datasets.
We strongly recommend that you back up your catalog before running this utility. Check that your MFSYSCAT points to the correct catalog.
old-string is compared to the string actually stored in the catalog, so, in the case of a file accessed via a Fileshare server, old-string should start with the Fileshare server name preceded by $$.
In all these examples, we'll assume your catalog is c:\catalog\catalog.dat.
You have a set of datasets in directory c:\datasets and you move them all to e:\datasets. To update the catalog:
set mfsyscat=c:\catalog\catalog.dat set mfalloc_loc=e:\datasets mvspcrn c e
You have a set of datasets in directory c:\datasets and you move them all to e:\data. To update the catalog:
set mfsyscat=c:\catalog\catalog.dat set mfalloc_loc=e:\datasets mvspcrn c:\datasets e:\data
You have a set of datasets accessed via Fileshare server server1. They are in c:\fsdir\datasets, where c:\fsdir is the Fileshare directory for server1. You do not move the datasets, but you stop the server and restart it with a different name, server2. To update the catalog:
set mfsyscat=c:\catalog\catalog.dat set mfalloc_loc=$$server1\datasets mvspcrn $$server1 $$server2
You have a set of datasets accessed via Fileshare server server1. They are in c:\fsdir\datasets, where c:\fsdir is the Fileshare directory for server1. You move the datasets to c:\fs2dir\data, where c:\fs2dir is the Fileshare directory for server2. In future you want to access them via server2. To update the catalog:
set mfsyscat=c:\catalog\catalog.dat set mfalloc_loc=$$server1\datasets mvspcrn $$server1\datasets $$server2\data
You have a set of datasets accessed via Fileshare server server1. They are in c:\fsdir\datasets, where c:\fsdir is the Fileshare directory for server1. Those associated with your payroll application all have names beginning payroll, and you move these to c:\fs2dir\data, where c:\fs2dir is the Fileshare directory for server2. In future you want to access these files via server2. To update the catalog:
set mfsyscat=c:\catalog\catalog.dat set mfalloc_loc=$$server1\datasets mvspcrn $$server1\datasets\payroll $$server2\data\payroll
FSView is a command-line utility for administering Fileshare servers. Entering the command fsview puts you into FSView mode, where you can enter a range of commands. For full details, see your Fileshare Guide.
When you use some of the features described later in this chapter, you cannot control Fileshare interactively from the Fileshare console window. So you need to use FSView instead, most importantly for closing a Fileshare server. This section gives brief instructions on FSView, to enable you to do this.
Fileshare security is off by default and is not covered in this chapter (see your Fileshare Guide for details). However, to use FSView you must create a password for the special user ID FSVIEW and enter this user ID and password when you connect to your Fileshare server from the FSView utility.
You specify passwords in a password file, containing a password for each user who will be connecting to the Fileshare server. You do this by running a command for each user. The first such command creates the file.
If this file contains more than one entry, specifying this file when starting a Fileshare server turns on security for that server. All clients then have to specify their user IDs and passwords when they connect. However, since for our present purpose we need only create one entry, this does not happen.
Here is a brief walkthrough to demonstrate FSView. In the following, you create the password file, start a Fileshare server, and then use the FSView utility to close it.
fs /pf pass.dat /u FSVIEW /pw Meryton
This creates a password file called pass.dat, containing an entry for the user ID FSVIEW with password Meryton. The contents of this file are encrypted for secrecy.
User IDs and passwords are case-sensitive.
Note this call of fs.exe does not start a server, as you have not specified the /s parameter.
start fs /s server1 /pf pass.dat /sc
fsview
You now see the FSView command prompt.
admin logon FSVIEW Meryton
server set server1
server shutdown
The server does not close yet. This command does not take effect until you exit from FSView.
exit
FSView and the Fileshare server both close.
There are a number of changes you can make to your Fileshare server to make it run faster.
The Synchronous Communications option can improve performance up to the order of 10 times. You enable this simply by specifying the /sc parameter on the fs.exe command line.
This improves performance greatly but has no impact on the ability of the client (in this case an enterprise server) to interact with the Fileshare server.
However, it means Fileshare polls the keyboard very seldom, so it is impractical to administer Fileshare from the keyboard - for example, you cannot close a Fileshare server by entering Esc. Instead you must use the FSView utility, which is briefly described in the section FSView.
If your server machine is a multi-processor machine, you can use a mechanism called processor affinity for fs.exe. You can experiment with this setting via a popup menu accessible from the Process List on the Task Manager. Right-click fs.exe in the process list, and you can then select a context for the process. If you have the Windows Server resource kit installed, it includes a utility called imagecfg which you can use to permanently set processor affinity for a given .exe file.
For an introduction to processor affinity, and why you might wish to tune it, see TMurgent Technology's white paper Processor Affinity - Multiple CPU Scheduling.
You can specify your parameters to fs.exe in a configuration file, as an alternative to the command line.
If you give no parameters on the command line, then fs.exe looks for a configuration file. By default it looks for a file called fs.cfg in the Fileshare directory, that is, the directory where you started fs.exe. You can use the /cf parameter to specify a different path and/or filename.
For example, you could have a configuration file c:\fsdir\fsconf.cfg containing:
/s server1 /tr f
and start your server server1, from your Net Express command prompt, by entering the command:
fs /cf fsconf.cfg
Another example: you could have a configuraiton file c:\fsdir\fs.cfg containing:
/s server1
and start your server by entering:
fs
You can install Fileshare as a Windows service. You install it by simply entering:
fsservice -i
at a Net Express command prompt. You can then start and stop it from the Windows Control Panel. You can uninstall it by entering:
fsservice -u
When you run Fileshare as a service, you must use a configuration file to pass your settings, and this file must be called fs.cfg. It must be in your c:\windows\system32 directory.
In your configuration file, you can use the /wd setting to specify your Fileshare directory.
When Fileshare is running as a service, you do not get a Fileshare console window, so cannot control it interactively via this window. Consequently:
This example demonstrates several of the features described in this chapter. We'll start a Fileshare server, just as we did in the chapter Using Enterprise Server with Fileshare, but this time we'll use a configuration file, install Fileshare as a Windows service, and enable synchronous communications and tracing.
First make sure you do not have a Fileshare server currently running.
/s server1 /wd c:\fsdir /pf pass.dat /sc /tr f
fs /pf pass.dat /u FSVIEW /pw Meryton
The existence of this password file enables you to use FSView.
fsservice -i
to install the Fileshare service.
You can also if you wish double-click Micro Focus Fileshare Service and change its Startup Type to Automatic, so that it will start whenever you start Windows.
Copyright © 2006 Micro Focus (IP) Ltd. All rights reserved.