|
The SYSTEM() function returns information regarding the status of various aspects of the system.
Format
SYSTEM(key)
where
| key | identifies the information to be returned. |
The SYSTEM() function is provided for compatibility with other data management products. Many of the key values correspond to those found in other multivalue database products though some values are implemented inconsistently across products. Values 1000 and above are usually specific to QM.
The following key values are implemented. All other key values return a zero value. There are tokens defined for these key values in the SYSCOM KEYS.H include record.
Key Function
| 1 | Returns 1 if a PRINTER ON statement is in effect |
| 2 | Current page width of the default print unit (printer 0 if PRINTER ON has been done, otherwise the screen) |
| 3 | Current page length of the default print unit (printer 0 if PRINTER ON has been done, otherwise the screen) |
| 4 | Lines remaining on current page of the default print unit (printer 0 if PRINTER ON has been done, otherwise the screen) |
| 5 | Current page number of the default print unit (printer 0 if PRINTER ON has been done, otherwise the screen) |
| 6 | Current line number of the default print unit (printer 0 if PRINTER ON has been done, otherwise the screen) |
| 9 | Cumulative processor time used (mS) by this QM session |
| 10 | Input waiting in the DATA queue? (1 if so, 0 if not) |
| 11 | Select list 0 active? (1 if so, 0 if not) |
| 12 | Time in seconds since midnight (same as TIME()). The default behaviour of the SYSTEM(12) function is to return an integer number of seconds. Enabling the TIME.MS setting of the $MODE compiler directive causes the return value of the SYSTEM(12) function to have a fractional part to millisecond precision. |
| 13 | Relinquish timeslice. Always returns 1. |
| 14 | Returns the number of characters in the type-ahead buffer. This is unreliable for piped input. |
| 16 | Returns the command processor level (same as @LEVEL) |
| 19 | Returns a unique value formed from the internal form date and time in the user's time zone as two five digit numbers. If the function is used more than once system wide in the same second, an alphabetic suffix is added to create a unique value. This function is unreliable in applications where users span multiple time zones. |
| 20 | Returns the system wide reference number for last print job passed to the operating system spooler (Linux only). See also the PU$SEQNO key to GETPU(). |
| 21 | Returns a unique value formed from the internal form date and a sequential number that resets each day. |
| 23 | Break key enabled? (1 if so, 0 if not) |
| 24 | Input echo enabled? (1 if so, 0 if not) |
| 25 | Is this a phantom process? |
| 26 | Returns the current input prompt character |
| 27 | Returns the operating system uid for the user's process. (Not Windows) |
| 28 | Returns the operating system effective uid for the user's process. (Not Windows) |
| 29 | Returns the operating system gid for the user's process. (Not Windows) |
| 30 | Returns the operating system effective gid for the user's process. (Not Windows) |
| 32 | Returns the system (QMSYS) directory pathname |
| 33 | Returns the name of the program that called this subroutine |
| 35 | Returns current number of interactive users |
| 38 | Returns temporary directory pathname |
| 42 | Returns telnet connection IP address, null for a console user |
| 45 | Returns the program catalogue name or pathname if not catalogued. |
| 91 | Returns 1 on Windows, 0 on other platforms |
| 1000 | Returns 1 if EXECUTE CAPTURING is in effect, 0 otherwise |
| 1001 | Returns 1 if case inversion is enabled, 0 otherwise |
| 1002 | Returns the program call history. This is a dynamic array in which each program is represented by a field, the current program being in field 1. The first value in each field contains the program name. Subsequent values are divided into two subvalues containing the program address and line number (where available) for each internal subroutine call (GOSUB) in the program. The first value in each field has an additional third subvalue containing the compile time of the program as an epoch value. |
| 1003 | Returns a dynamic array containing a list of open files. Each field has two values; the first holds the internal file number, the second holds the file's pathname. |
| 1004 | Returns the peak number of files that have been open at one time since QM was started. |
| 1005 | Returns the combined date and time value as DATE() * 86400 + TIME() based on the user's time zone. |
| 1006 | Returns 1 if running on a Windows NT style system (XP and later). This will always be true on Windows as earlier releases are no longer supported. |
| 1007 | Returns the current transaction number, zero if not in a transaction. |
| 1008 | Returns the current transaction nesting level, zero if not in a transaction. |
| 1009 | Returns the system byte ordering, 1 for high byte first, 0 for low byte first. |
| 1010 | Returns the platform name; Windows, Linux, FreeBSD, AIX, Mac, PDA, Solaris, Rpi. |
| 1011 | Returns the pathname of the QM configuration file |
| 1012 | Returns the QM version number. |
| 1013 | Returns user limit, excluding users reserved for phantom processes. |
| 1014 | Returns user limit, including users reserved for phantom processes. |
| 1015 | Returns the name of the host computer system. |
| 1016 | Returns the remaining number of licensed non-phantom users. |
| 1017 | Returns the tcp/ip port number for a socket connection. |
| 1018 | Returns the device licensing connection limit. |
| 1019 | Returns the offset in seconds of the user's local time zone from UTC. This will be negative for zones to the west of longitude zero. |
| 1020 | Returns the time of day in milliseconds since midnight UTC. |
| 1021 | Returns the currently selected ECS base map name. On a non-ECS system, this returns the current map name, null if using the default map. |
| 1023 | Returns True on 64 bit systems, False on 32 bit systems. |
| 1024 | Returns the current working directory pathname when QM was entered. |
| 1025 | Returns a dynamic array where field 1 is a multivalued list of environment variable names and field 2 is a corresponding list of their values. |
| 1026 | Returns xxx when QM is entered using "qm xxx". |
| 1027 | Returns the name of the serial port when logged in on a serial connection. |
| 1028 | Returns the system id of the active QM licence, zero if the licence is not system specific. |
| 1029 | Returns the current internal subroutine depth. |
| 1030 | Returns login time as date * 86400 + time in the user's local time zone using Pick date numbering. |
| 1031 | Returns operating system process id. |
| 1032 | Returns and clears the break pending flag, set if the break key is pressed with breaks disabled. |
| 1033 | Returns True if a COMO file is active. |
| 1034 | Returns True if COMO output is active but suspended. |
| 1035 | Returns the time as seconds since 00:00:00 on January 1 1970, Universal Coordinated Time (UTC) independent of the user's time zone. Same as the EPOCH() function. |
| 1036 | Returns the period in tenths of a second for which login was delayed waiting for a spare user. See the LGNWAIT configuration parameter. |
| 1037 | Returns a dynamic array with one field for each open QM file. In each field, value 1 holds the internal file number, value 2 holds the file pathname and value 3 is a subvalue mark delimited list of QM user numbers for which the file is open. |
| 1040 | Returns True if operating system filenames are case insensitive. |
| 1041 | Used on a replication publisher system, returns a field mark delimited list of replication subscribers actively transferring data. |
| 1042 | Returns the system id of the server. This will differ from SYSTEM(1028) for a USB installation or a licence that is not system specific. |
| 1043 | Returns the current CSV mode that determines quoting rules as set by CSV.MODE. |
| 1044 | Returns True if the system is running in ECS mode. |
| 1045 | Returns time at which QM was started as an epoch value. |
| 1046 | Returns the current CSV delimiter character set by CSV.MODE. |
| 1047 | Returns a globally unique identifier (GUID) string. Platforms that do not support this operation return a null string. |
| 1048 | Returns a rolling sequence number that is unique across all sessions until QM is restarted when it is reset to 1. |
| 1049 | Returns True if HUSH is in effect, otherwise returns False. |
| 1050 | Returns True if the current user is a QM system administrator, otherwise returns False. This will be True if any of... |
a) The user is an administrator at the operating system level.
b) The user logs in via a Windows QMConsole session.
c) The user is defined as an administrator using the ADMIN.USER command.
d) QM security is disabled (see the SECURITY command).
| 1051 | Returns True if QM is running as a USB installation. |
| 1052 | Returns count of direct descendant child (phantom) processes. |
| 1053 | Returns the highest user number that can be assigned on this system. |
| 1054 | Returns field mark delimited list of active packages. |
| 1055 | Returns a field mark delimited dynamic array containing statistical information related to the LGNWAIT configuration parameter: |
| 1 | The number of times login has been delayed. |
| 2 | The number of successful logins. |
| 3 | The number of processes currently delayed waiting for login. |
| 4 | The peak number of processes waiting for login. |
| 5 | The number of login attempts that failed after waiting. |
| 1056 | Returns a field mark delimited dynamic array containing user count information: |
| 1 | The number of interactive users. |
| 2 | The number of QMClient users. |
| 3 | The number of interactive phantom users. |
| 4 | The number of non-interactive phantom users. |
| 5 | The peak number of concurrent licensed users. |
| 1057 | Returns the parent process user number, zero if the current process is not a phantom or the parent has terminated. |
| 1058 | Returns a field mark delimited list of child phantom process user numbers. |
| 1059 | Returns the system licence site text. |
| 1060 | Returns the pool name for a QMClient connection pooling session. |
| 1061 | Returns QMSYS drive letter on Windows, null elsewhere. Same as @DRIVE |
| 1062 | Returns and clears cross-process application signal state. |
| 1065 | Returns diagnostic data from the transaction cache as a dynamic array. Each field represents a cached action and is formed from four value mark separated items; the transaction number, file number, id and mode (D = delete, W = write). Use SYSTEM(1003) to translate file numbers to pathnames. |
| 1066 | Returns last form queue number assigned with SP.ASSIGN. |
| 1067 | Returns default group size in bytes. |
| 1068 | Returns Proc output buffer status. True if secondary buffer is active. |
| 1069 | Returns Proc input buffer status. True if secondary buffer is active. |
| 1071 | Returns a dynamic array of file information after OSREAD. |
| 1072 | Returns the IP address on which QM listens for incoming telnet, QMClient, QMNet and replication connections. Null if listening on all configured IP addresses. See the IPADDR configuration parameter. |
| 1073 | Returns a field mark delimited list of grouped child phantom process user numbers. |
| 1075 | Returns a dynamic array of connection pooling configuration information, one field per pool with values for name, connection limit, timeout, current idle process count, peak idle process count, current active process count and peak active process count. |
| 1076 | Returns the current CALL depth. |
| 1077 | Returns a field mark delimited list of group names to which the user belongs (not Windows). |
| 1078 | Returns a field mark delimited list of group numbers to which the user belongs (not Windows). |
| 1079 | Is this a QMClient process? |
| 1080 | Returns True if program was started from a Proc, else returns False. |
| 1081 | Returns epoch time as milliseconds since 1 Jan 1970 UTC. |
| 1082 | Returns time of day as milliseconds since midnight in user's time zone. |
| 1083 | Returns information about the last deadlock as a dynamic array with a field for each process in the deadlock, divided into three values as the user number, file pathname and record id. The record id is omitted for a file lock. |
| 1086 | Returns True if the program has case sensitivity for string comparisons enabled, otherwise returns False. |
| 1087 | Used on a replication publisher system, returns a field mark delimited list of replication subscribers that are active but paused. |
| 1088 | Returns the position of the dynamic array element after use of MAXIMUM() or MINIMUM(). |
| 9010 | Returns "QM" for U2 compatibility |
QM allows users to add definitions for their own SYSTEM() function key values by writing a QMBasic subroutine that performs whatever processing is required. This subroutine takes two arguments. The first is used to return the result and the second is the key value passed in. This subroutine must be catalogued as $SYSTEM.
|