Please enable JavaScript to view this site.

A-Shell Consolidated Reference

xcall USRCNT, pcount {,lcount, mcount, ixcount}

USRCNT returns the number of physical nodes in use, logical nodes in use, maximum number of physical nodes allowed, and the number of instances of A-Shell that are running.

Parameters

pcount (F,6)  [out]

returns the number physical nodes currently in use. Physical nodes count against the license. In theory, each physical workstation counts as a physical node, but due to the many ways in which devices can be attached and sessions established, the counter can sometimes be "fooled." However, for each physical node, there will always be at least one logical node.

lcount (F,6)  [out]

returns the number of logical nodes (or jobs) currently in use. Logical nodes do not count against the license. When the number of logical nodes is greater than the number of physical nodes, it should be because of background sessions or multiple sessions originating from the same physical workstation.

mcount (F,6)  [out]

returns the maximum number of physical nodes (i.e. the number specified in the license).

ixcount (F or I)  [out]

returns the executable instance count, including the current instance. -1 indicates some kind of error, like an inability to execute the ps command under Unix. 0 would indicate a different kind of error—i.e. that the current instance is detecting neither itself nor any other error while scanning the process or window list.

For Windows, this is a count of windows sharing the A-Shell main window class (MIAMEWClass). Note this would include A-Shell/Windows and ATE, which could involve more than one actual ashw32.exe executable. Note that in a peer-to-peer environment, one peer running this function would not see the other peers that may be sharing the same copy of ashw32.exe. In this case, you should probably use SYSTAT as well to check for the possibility of other instances of A-Shell which share the ashw32.exe disk copy, but which are in different memory spaces or different workstations.

For Unix, it uses ps to check for processes whose launch command references the current executable (which isn't necessarily named "ashell").

In either case if the ixcount value is greater than the lcount (logical instance) value, that implies that there are instances of A-Shell running that aren't sharing the same jobtbl.sys.

This parameter was added to USRCNT in A-Shell build 988.4 of 10 May 07 primarily for the benefit of ASHUPD—i.e., to make sure there are no other instances of A-Shell running that would interfere with an update. The function might also be useful to applications attempting to monitor usage for the same reasons they are already using USRCNT.

Example

This simple program demonstrates the use of USRCNT.

MAP1 PCOUNT,F,6            ! # physical nodes

MAP1 LCOUNT,F,6            ! # logical nodes

MAP1 MCOUNT,F,6            ! # maximum nodes licensed

MAP1 IXCOUNT,F,6           ! # current instances

 

XCALL USRCNT,PCOUNT,LCOUNT,MCOUNT,IXCOUNT

 

? "# Physical Users:       ";PCOUNT

? "# Logical Users:        ";LCOUNT

? "# Licensed Nodes (max): ";MCOUNT

? "# Current Instances:    ";IXCOUNT

end