330B TerminalStatus¶
Stub MON 330B (216 decimal) · Mnemonic TERST · Group: Monitor Calls for Terminal Handling (manual section 2.6)
Available from: All programs (manual compatibility box)
Emulation source: src/handlers/mon_330B_TerminalStatus.c
Description¶
Gets information about a terminal. The user logged in, the time logged in, the CPU time used, the job being executed, and more is returned.
- You may use the monitor call for batch jobs.
- This call can only be used from background programs, not RT programs.
Notes¶
- Version history: in the M-version the CPU-time returned by MON 330 (TERST) is now the sum of the ND-100 CPU time and the ND-500/5000 CPU time (ND-860230-7A-EN SINTRAN III - Release Information - M-Version.md:1186-1188).
Parameters¶
| Name | Type | Direction | Description |
|---|---|---|---|
DeviceNumber |
INTEGER | In | Logical device number of a terminal. Use 1 for your own terminal. |
Buffer |
ARRAY | Out | 44 byte buffer receiving terminal info: bytes 0-15=user name, 16-17=mode (1=command, 2=program), 18-19=state (-1=not logged in, 0=idle batch, 1=active), 20-21=CPU time (min), 22-23=time logged in (min), 24-43=last command. |
Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.
See also¶
@TERMINAL-STATUS
Compatibility¶
| Machines | Users | Programs |
|---|---|---|
| ND-100 and ND-500 | All users | All programs |
The manual's compatibility box for this call, word for word.
Yes/no fields from the YAML extraction (not in the manual's words):
| ND-100 | ND-500 | User programs | RT programs | System programs |
|---|---|---|---|---|
| No | No | Yes | Yes | No |
Disagreement
The manual box says ND-100 and ND-500, but the yes/no fields say ND-100 = No, ND-500 = No. The manual box is the source.
Examples¶
From the manual (OCR text, not corrected).
INTEGER : DeviceNumber
BYTES : Buffer(0:43)
...
ON ROUTINEERROR DO
IF ErrCode > 0 THEN ...
ENDON
Monitor_Call('TerminalStatus', DeviceNumber, Buffer(0))
INTEGER DeviceNumber
INTEGER Buffer(22)
...
Monitor_Call('TerminalStatus', DeviceNumber, Buffer(1))
IF (ErrCode .NE. 0) THEN ...
DeviceNumber : INTEGER2;
Buffer : ARRAY [0..1] OF RECORD...END;
...
TermStatus(DeviceNumber, Buffer); [Note routine name.]
IF ErrCode <> 0 THEN ...
01 DeviceNumber COMP.
01 Buffer.
02 array COMP OCCURS 22 TIMES.
01 ErrCode COMP.
...
MONITOR-CALL "TerminalStatus" USING DeviceNumber, Buffer.
CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
DeviceNumber : W BLOCK 1
Buffer : H BLOCK 25B
ErrCode : W BLOCK 1
TerminalStatus : EQU 37B9 + 330B
...
CALLG TerminalStatus, 2, DeviceNumber, Buffer
IF K GO ERROR
...
ERROR : W1 =: ErrCode
%ErrorCode in W1 register.
LDT LDN %Load register T with the logical device number.
LDA (BUF %Load register A with address of return buffer.
MON 330 %Monitor call TerminalStatus.
STA STAT %Returned status.
...
LDN, 1
BUF, 0
*+26/ %Buffer of 44 bytes.
STAT, 0
ndmonlib implementation¶
Stub Registered MON_STATUS_NOT_IMPLEMENTED: the handler is a stub. mon_dispatch() in src/core/mon_dispatch.c reports the call as unimplemented without calling it.
| Handler | mon_330B_TerminalStatus |
| Code lines | 6 (non-blank, non-comment lines in the file) |
Source¶
SINTRAN III Monitor Calls (ND-860228.2 EN), page 537.