Skip to content

40B CloseSpoolingFile

Stub   MON 40B (32 decimal) · Mnemonic SPCLO · Group: Input and Output Monitor Calls (manual section 2.5)

Available from: All programs (manual compatibility box)

Emulation source: src/handlers/mon_40B_CloseSpoolingFile.c

Description

Appends an opened file to a spooling queue. You specify a text to be printed on the error device when the file is to be printed.

  • If the file is not a spooling file, a normal close is performed.
  • Does not work for remote files. For these, a normal close is performed.

Parameters

Name Type Direction Description
FileNo INTEGER2 In File number given when the file was opened.
UserText STRING In Text to be output on the error device when printed.
NoOfCopies INTEGER2 In Number of print copies.
PrintFlag INTEGER2 In Print flag. 0=output text only if required by @DEFINE-SPOOLING-CONDITIONS, non-zero=print unconditionally.

Direction: In = the program supplies the value, Out = the call returns it, In/Out = both.

See also

CloseFile, AppendSpooling, @DEFINE-SPOOLING-CONDITIONS

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
Yes Yes No No No

Examples

From the manual (OCR text, not corrected).

INTEGER : FileNo, NoOfCopies, PrintFlag
BYTES : UserText(0:79)
...
ON ROUTINEERROR DO
  IF ErrCode > 0 THEN ...
ENDON
Monitor_Call('CloseSpoolingFile', FileNo, UserText, NoOfCopies, PrintFlag)
INTEGER FileNo, NoOfCopies, PrintFlag
CHARACTER UserText*80
...
Monitor_Call('CloseSpoolingFile', FileNo, UserText(1:80),
             NoOfCopies, PrintFlag)
IF (ErrCode .NE. 0) THEN ...
FileNo, NoOfCopies, PrintFlag : INTEGER2;
UserText : PACKED ARRAY [0..79] OF CHAR;
...
CloseSpoolingFile(FileNo, UserText, NoOfCopies, PrintFlag);
IF ErrCode <> 0 THEN ...
01 FileNo COMP.
01 NoOfCopies COMP.
01 PrintFlag COMP.
01 UserText PIC X(100).
01 ErrCode COMP.
...
MONITOR-CALL "CloseSpoolingFile" USING FileNo, UserText,
                                  NoOfCopies, PrintFlag.

CALL "CbError" USING ErrCode.
IF ErrCode NOT = 0 GO ...
FileNo : W BLOCK 1
NoOfCopies : W BLOCK 1
PrintFlag : W BLOCK 1
UserText : STRINGDATA 'Printing file...'
ErrCode : W BLOCK 1
CloseSpoolingFile : EQU 37B9 + 40B
...
  CALLG CloseSpoolingFile. 4, FileNo, UserText, NoOfCopies, PrintFlag
  IF K GO ERROR
  ...
ERROR : W1 =: ErrCode                  %ErrorCode in W1 register.




LDT FILNO                 %File number returned from earlier open.
LDA NOCOP                 %Number of copies.
COPY SA D0
LDA FLAG                  %Condition flag.
LDX (TEXT                 %Address of text to be sent to error device.
MON 40                    %Monitor call CloseSpoolingFile.
JMP ERROR                 %Error return from monitor call.
...                       %Normal return.
ERROR, ...                %Error number in register A.
...
FILNO, ...
TEXT, 'GUMMED LABELS'     %Message when the file is to be printed.
NOCOP, ...
FLAG, 0                   %Text is only written if required by
                          % @DEFINE-SPOOLING-CONDITIONS.




Scanned by Jonny Oddene for Sintran Data © 2020

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_40B_CloseSpoolingFile
Code lines 9 (non-blank, non-comment lines in the file)

Source

SINTRAN III Monitor Calls (ND-860228.2 EN), page 119.