skip to main content

isCOBOL File Server : isCOBOL File Server usage

isCOBOL File Server usage
The File Server daemon can be started with the following command:
iscserver -fs [-c config_file] [-fsport FSport] [-hostname host] [-as] [-port ASport] [-force]
Setting iscobol.as.fileserver (boolean) to true in the configuration produces the same effect as using the -fs option while setting iscobol.as.appserver (boolean) to true in the configuration produces the same effect as using the -as option.
The following command starts the File Server on the local pc on the default port 10997:
A correct startup will produce an ouptut similar to this:
You can start both the Application Server and the File Server at the same time with the command:
Both services can start on different ports than the defaults. Use the -fsport and -port options to control the port where the services will be listening. The following command, for example, starts the File Server on the port 1234 and the Application Server on the port 1235:
The File Server host name and port can also be set in the configuration file, as shown below.
Config_file should include the standard configuration, that is the same for every client. See Usage of isCOBOL Client for informantion about how to use a customized client configuration.
Client-side Configuration
There are two ways a program can use a remote file on the File Server.
1.
2.
The ISF protocol
It is possible to specify File Server connection information in the physical file name through the URL syntax as follows:
Where
hostname is the server name or IP address where the File Server is listening
port is the port where the File Server is listening. If omitted, the default port 10997 is used
path/to/file is the name of the remote file to open. It can be either a full path, a relative path or just the file name. If omitted, the root folder is assumed, so a path like "isf://localhost:" is equivalent to "isf://localhost:/".
The URL can be put entirely in the file name or can be built by combining the FILE-PREFIX setting and the file name.
The following code snippets show two ways to open FILE1 through the File Server listening on 192.168.0.1 on the default port. The file will be searched in the /usr/data folder on the server:
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT FILE1 ASSIGN TO "isf://192.168.0.1:/usr/data/FILE1"
       FILE SECTION.
       FD FILE1.
       01 FILE1-RECORD.
          03 FILE1-KEY  PIC 9(3).
          03 FILE1-DATA PIC X(50).
       PROCEDURE DIVISION.
           OPEN INPUT FILE1.
 
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT FILE1 ASSIGN TO "FILE1"
       FILE SECTION.
       FD FILE1.
       01 FILE1-RECORD.
          03 FILE1-KEY  PIC 9(3).
          03 FILE1-DATA PIC X(50).
       PROCEDURE DIVISION.
           SET ENVIRONMENT "file.prefix" TO "isf://192.168.0.1:/usr/data".
           OPEN INPUT FILE1.
The DynamicRemote class
In order to access remote files, client programs can assign their files to the "com.iscobol.io.DynamicRemote" class. In the configuration, it’s also possible to use the alias "remote".
The class can be assigned in the SELECT statement. See FILE-CONTROL Paragraph, rule 35 for information about how to assign a file to a specific class.
For example, the following sequential file will be opened through the File Server, regardless of the file name that the program puts in the ARC-NAME variable:
SELECT ARC ASSIGN TO ARC-NAME
           ORGANIZATION LINE SEQUENTIAL
           CLASS "com.iscobol.io.DynamicRemote"
The assignement can be done also through the following configuration properties:
For example, the following configuration entry causes all the indexed files to be opened through the File Server:
Client programs are made aware of the File Server location through the configuration properties iscobol.file.remote.host * and iscobol.file.remote.port *.
Since the full-path of the file is built client-side by the runtime before sending the i/o request to the File Server, iscobol.file.prefix must be set in the client configuration and must specify the directories on the server where files will be opened. If the server operating system uses a different file separator than the client, the property iscobol.file.prefix_separator must be set in the client configuration as well.
The following client configuration, for example, handles only indexed files remotely on the Linux server whose IP is 192.168.0.1 assuming that the File Server is listening on the default port:
The following more complex sample configuration, instead, handles indexed, sequential and relative files remotely on the Linux server whose IP is 192.168.0.1 having the File Server listening on the port 12345:
User Authentication
If iscobol.as.authentication * is set to 2 in the server configuration, iscobol.user.name and iscobol.user.passwd must be set client side in order to specify login information.

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left