C$OSLockInfo not works with MF format files

We use C$OSLockInfo rutine to know which process is blocking one register file; the rutine returns the PID. It works OK with RM files format, but when we use it with MF files format, the rutine returns all 0.

Should we use the rutine in a diferent way when we use it with MF format files? Maybe we have to use another tool to get this information?

Thank you

Parents
  • Hi mikmng,

    Since wholock is not a subprogram like C$OSLockInfo, I don't believe you'll be able to call it directly as a subroutine. However, you can use the Micro Focus function CALL "SYSTEM" to invoke wholock, with something like:

          move spaces to who-command
          move "testfile.dat" to file-to-check
          string
             "wholock "       delimited by size
             file-to-check    delimited by space
             " >wholock_results.txt"
             x"00"
            into who-command
          end-string
          call "SYSTEM" USING who-command

    Then, your program could read the contents of wholock_results.txt to determine the offending process(es). (Please bear in mind that this is a simple example, and is not meant to be used in a real application without some further coding.)

Reply
  • Hi mikmng,

    Since wholock is not a subprogram like C$OSLockInfo, I don't believe you'll be able to call it directly as a subroutine. However, you can use the Micro Focus function CALL "SYSTEM" to invoke wholock, with something like:

          move spaces to who-command
          move "testfile.dat" to file-to-check
          string
             "wholock "       delimited by size
             file-to-check    delimited by space
             " >wholock_results.txt"
             x"00"
            into who-command
          end-string
          call "SYSTEM" USING who-command

    Then, your program could read the contents of wholock_results.txt to determine the offending process(es). (Please bear in mind that this is a simple example, and is not meant to be used in a real application without some further coding.)

Children
No Data