CALL "A$LIST_LOCKS" USING opCode                            parameters                     GIVING returnCode  | 
opCode   | The function to be executed. Valid values, defined in iscobol.def, are:  | |
Open the list.  | ||
Retrieve the next item in the list.  | ||
Close a previously open list.  | ||
parameters  | Parameters depend on the opcode.  | |
working-storage section. copy "iscobol.def". 77  locklist                handle. 77  th-id                   pic 9(5). 77  usr-id                  pic x(3). 77  usr-name                pic x(32). 77  usr-addr                pic x(32). 77  usr-pcname              pic x(32). 77  usr-tid                 pic x(32). 77  usr-prog                pic x(32). 77  usr-count               pic 9(5). 77  lock-count              pic 9(5). 77  lock-filename           pic x(50). 77  lock-tid                pic 9(5). 77  lock-open-mode          pic 9(5). 77  lock-mode               pic 9(5). 77  lock-key-val            pic x(256). 77  lock-key-len            pic 9(3). get-locks-list.    initialize lock-filename lock-tid    call "a$list-locks" using listlock-open                              null                              lock-filename                              lock-tid                       giving locklist    if locklist < 1       display message                "No Locks Found (verify iscobol.file.lock_manager)"       exit paragraph    end-if    move 0 to lock-count    perform until 1 = 2       call "a$list-locks" using listlock-next                                 locklist                                 lock-filename                                 lock-tid                                 lock-open-mode                                 lock-mode                                 lock-key-val                                 lock-key-len  | 
      if return-code = 0          exit perform       end-if       add 1 to lock-count       | to get user information from lock-tid       call "a$get-user" using lock-tid                               usr-id                               usr-name                               usr-addr                               usr-pcname                               usr-prog    end-perform    call "a$list-locks" using listlock-close                              locklist    display message "Number of locks : " lock-count.  |