Using SFS files

To access Encina SFS files from a COBOL application that runs under AIX, you must follow guidelines for compiling and linking, and for identifying the file system, the Encina SFS server, and the SFS files.

  1. Compile and link the COBOL programs in the application by using the cob2 command.
  2. Ensure that the Encina SFS server that your application will access is running.
  3. Set the ENCINA_CDS_ROOT environment variable to the fully qualified name of the Encina SFS server.

    For example:

    export ENCINA_CDS_ROOT=/.:/cics/sfs/sfsServer

    Or for more flexibility, and in any case if your application uses multiple SFS servers, set ENCINA_CDS_ROOT to the path up to but not including the server name:

    export ENCINA_CDS_ROOT=/.:/cics/sfs
  4. (Optional) If your application creates one or more SFS files, and you want to allocate the files on an SFS data volume that has a name other than encinaSfsVol, you can specify either or both of the following names:
    • The name of the SFS data volume on which the SFS files are to be created. To do so, assign a value to the runtime environment variable ENCINA_SFS_DATA_VOLUME. The data volume must have been defined to the SFS server. If you do not know which data volumes are available to the SFS server, issue the command sfsadmin list lvols.

      By default, SFS files are created on the data volume that is named encinaSfsVol.

    • The name of the SFS data volume on which alternate index files, if any, are to be created. To do so, assign a value to the runtime environment variable ENCINA_SFS_INDEX_VOLUME. The data volume must have been defined to the SFS server.

      By default, alternate index files are created on the same volume as the corresponding base files.

  5. Identify each SFS file:
    • Either set the default file system to SFS by setting the runtime option FILESYS as follows:
      export COBRTOPT=FILESYS=SFS

      Or alternatively, in an export command for each SFS file, precede the file name and SFS server name with the file-system ID SFS followed by a hyphen (-), as shown below.

    • The Encina SFS server name must precede the file name.
    • Any alternate index file names must start with the base file name, followed by a semicolon (;) and the alternate index name.

    For example, if /.:/cics/sfs/sfsServer is the Encina SFS server, and SFS04A is an SFS file that has alternate index SFS04A1, you could identify SFS04A by issuing the following export command:

    export SFS04AEV="SFS-/.:/cics/sfs/sfsServer/SFS04A(/.:/cics/sfs/sfsServer/SFS04A;SFS04A1)"

For more information about fully qualified names for SFS servers and files, see the related task about identifying Encina SFS files.

Example: accessing SFS files