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 the module FHRdrPwd as follows:
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
...
You can substitute the FHRdrPwd 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 FHRdrPwd Module for further details.