UniVerse does not have a SYSTEM function to return the current spooler number. On other conversion projects we have written subroutines to execute SETPTR and capture the output. It is not a perfect solution because, unlike other platforms, UniVerse does not generate the spooler number when you do PRINTER ON; it generates it when you do the first actual PRINT statement.
This is what we do as well, far from ideal but we couldn't think of a better way. Here is the subroutine that we use that does the job.
0001: SUBROUTINE GET.SPOOLER.NUMBER.SUB(SPOOLER.NO,CHANNEL)
0002: * Purpose : Return the current spooler number.
0003: * Note : This needs to be run before the PRINTER CLOSE command or
0004: * &nbs p; before the program returns to TCL
0005: EQU SLASH TO '/'
0006: EXECUTE "SETPTR ":CHANNEL CAPTURING OUTPUT
0007: NO.OF.SLASH = DCOUNT(OUTPUT,SLASH)
0008: SPOOLER.NO = FIELD(OUTPUT,SLASH,NO.OF.SLASH)
0009: SPOOLER.NO = SPOOLER.NO[3,5]
0010: IF NUM(SPOOLER.NO) AND SPOOLER.NO # "" THEN
0011: SPOOLER.NO += 0
0012: END ELSE
0013: SPOOLER.NO = "ERROR"