skip to main content

Library Routines : A$LIST_USERS

A$LIST_USERS
The A$LIST_USERS library routine provides a number of functions to retrieve the list of users currently connected to the Application Server.
Syntax:
 CALL "A$LIST_USERS" USING opCode 
Parameters:
Return code:
The definition and meaning of the returnCode depend on the opcode.
Examples:
Example - Get the list of users connected to an Application Server. Call a$list-users to open the list, loop through all the next users and then close the list
working-storage section.
copy "iscobol.def".
77  usrlist                 handle.
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).
procedure division.
    call "a$list-users" using listusr-open
    if usrlist < 1
       display message "Error on User Count!"
       exit paragraph
    end-if
    move 0 to usr-count
    perform until 1 = 2
       call "a$list-users" using listusr-next
       if return-code = 0
       display "User ID: " usr-id "  User Name: " usr-name 
       add 1 to usr-count
    end-perform
    call "a$list-users" using listusr-close
    display message "Number of users connected : " usr-count

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left