Previous Topic Next topic Print topic


Fileshare Client

When Fileshare security is active, your program must supply a user-ID and a password before the first I/O operation is performed.

Even if you have not activated security, your program can still supply the Fileshare Client with a user-ID and password. This enables your program to run unchanged on Fileshare whether or not security is activated.

To register a user-ID and password, your program must call either the FHRdrLngPwd or FHRdrPwd module. You can only use the FHRdrPwd module with Fileshare configured for short usernames and passwords, while FHRdrLngPwd module can be used with Fileshare that is configured for either short or long usernames and passwords.

Note: Micro Focus recommends that you only use the single module that is appropriate to the username and password length your Fileshare is configured for.

FHRdrLngPwd Module

To call the FHRdrLngPwd module for Fileshare systems that support short or long usernames and passwords, that is a user-ID and user-password defined as pic x(100):

call "fhrdrlngpwd" using function-code,
                         user-ID,
                         user-password
end-call

where the parameters are:

01 function-code       pic x comp-x.
01 user-ID             pic x(100).
01 user-password       pic x(100).

The function code to register a user-ID and password is 1.

The following example shows how to register a user-ID and password:

working-storage section.
01 function-code    pic x comp-x.
01 user-name        pic x(100).
01 user-password    pic x(100).
...
procedure division.
...
    move 1 to          function-code
    move "UserID" to   user-name
    move "Password" to user-password
    call "fhrdrlngpwd" using function-code,
                             user-name,
                             user-password
    end-call
    ...
    open output testfile
    ...

You can substitute the FHRdrLngPwd module supplied with the Fileshare system with your own. This enables you to retrieve the user-ID and password from somewhere other than the application program. See the section Writing Your Own FHRdrLngPwd Module for further details.

FHRdrPwd Module

To call the FHRdrPwd module for Fileshare systems configured for short usernames and passwords, that is a user-ID and user-password defined as pic x(20).

call "fhrdrpwd" using function-code,
                      user-ID,
                      user-password
end-call

where the parameters are:

01 function-code       pic x comp-x.
01 user-ID             pic x(20).
01 user-password       pic x(20).

The function code to register a user-ID and password is 1.

The following example shows how to register a user-ID and password:

working-storage section.
01 function-code    pic x comp-x.
01 user-name        pic x(20).
01 user-password    pic x(20).
...
procedure division.
...
    move 1 to          function-code
    move "UserID" to   user-name
    move "Password" to user-password
    call "fhrdrpwd" using function-code,
                          user-name,
                          user-password
    end-call
    ...
    open output testfile
    ...
Previous Topic Next topic Print topic