|channel||An expression that resolves to an integer specifying an existing print channel. Valid values are 0 through 255.|
The GETPU function returns the name of the output device most recently used by the specified print channel. GETPU can be used both for SETPTR mode 1 (spooler) and SETPTR mode 3 (&HOLD& file) channel assignments.
For mode 1 (spooler) output, the returned value is a Caché global name, such as ^%MV.SPOOL(13). This global is the spooler to which the job is being spooled. GETPU in this mode only returns a value when a print job is open; otherwise, it returns a null string, with one exception. If the print job is closed, but the previous print job was marked as a HOLD job using the SETPTR HOLD option, GETPU returns the global name for that print job.
For mode 3 (&HOLD&) output, the returned value is the full path name of a file that GETPU creates to contain the spooler output. For example, a Windows file such as: c:\InterSystems\cache\mgr\user\&hold&\P#0000_0025. If a print job is currently open, GETPU returns details about the print job. If there is no print job open and the application executed a SETPTR command, GETPU returns the job ID that will be created when the next print job is created. If there is neither an open print job nor a SETPTR setting, GETPU returns the last job created.
If the channel value is a nonexistent print channel or an invalid value, GETPU returns the empty string.