Problem:
Resolution:
The Fileshare Server(fs.exe) is included with the Visual COBOL product in the installed bin directory and can be executed from the Visual COBOL Command Prompt. Below are instructions for configuring the Fileshare server to enable RM/COBOL file access:
Start a Visual COBOL Command Prompt box from your installed VCR4 Start Menu.
Specify the following in the fs.cfg file:
/s
/cm CCITCP
/d dbase.ref
where is the name you want to give to this Fileshare server.
Specify the following in the dbase.ref file:
/f * /ap ACUFH
This line tells Fileshare to use application ACUFH for all files. Please see the Fileshare documentation if you desire any other Fileshare configuration.
Set environment variable A_CONFIG to specify a config.cfg file. If you want to access RM files then config.cfg should contain at least:
DEFAULT_FILESYSTEM RMFM
Specify any other RM or ACU directives in config.cfg that you need. If you just want to access ACU Vision files then you may not need to set A_CONFIG at all.
Run Fileshare Server: fs
You should see something like the following:
Micro Focus COBOL
Version 1.3.00046 Copyright (C) Micro Focus IP Development Limited 1984-2011.
Fileshare Version 2 Revision 19999
FS101-I s ELMERFS -- parameter has been accepted.
FS101-I cm CCITCP -- parameter has been accepted.
FS101-I d dbase.ref -- parameter has been accepted.
FS084-I Fileshare Server is starting. (Revision 19999).
FS130-I Reading database reference file, please wait.
FS050-W A log file is not specified in the database reference file.
FS132-I The Fileshare Server is running with the following communications protocol(s):
CCITCP
FS085-I Fileshare Server is active.
You can hit the F2 key to toggle tracing on and off:
FS160-I Fileshare trace activated.
FS161-I Fileshare trace switched off.
Once you have configured the Fileshare Server for RM/COBOL file access, you will need to configure the Fileshare Client for your application. Below are instructions for enabling the Fileshare Client for your Visual COBOL for Visual Studio application(this will work in either managed, or, native code):
Start Visual COBOL for Visual Studio from the Windows Start Menu.
Create, or open, a managed or native code Visual COBOL Solution.
In the Project->Properties->COBOL->Additional Directives add callfh(fhredir). Also, add any other directives your program might need, such as DIALECT"RM", for RM/COBOL syntax support.
Right-click on the project in the Solution Explorer and, then, "Add a New Item" which will be an Application Configuration File. This will show as App.config in the project.
Right-click App.config and select Edit. In the Application Settings window that appears, Environment tab, add Variable Name FHREDIR with Value set to the full path of an fhredir.cfg file.
Specify the following in the fhredir.cfg file:
/f * /cm CCITCP /ct 100 /s
where is, guess what, the same server name you specified in the fs.cfg file above. The communication protocol is also the same, CCITCP. The /ct 100 is optional, it is a timeout value in centiseconds so /ct 100 specifies a 10 second timeout; the default timeout is much longer. This line specifies that all files are to use the Fileshare Server named . Please see the Fileshare documentation if you desire any other Fileshare configuration.
Compile and Run the program. You can Use F2 in the Fileshare Server box to turn on tracing to ensure that the Fileshare Server is actually being used when the program runs. By default, the files will be created/accessed in the current working directory of the Fileshare Server.
Please see the Fileshare documentation if you require any additional information in regards to the Fileshare product.
#fileshare
#rm
#ACUFH