Author Topic: Output to the HOLD file  (Read 17 times)

DonQuixote

  • Rock Star
  • *****
  • Posts: 200
  • To Dream the Impossible Dream...
Output to the HOLD file
« on: November 01, 2019, 09:07:47 am »
I'm trying to set output to the HOLD file.
In Process Definition Paragraph (/PD.P)
EXECUTE ">:SETPTR ,,,,,3,BANNER holdName"
EXECUTE "B:basicprogram"

The output in the basic program is not going to the HOLD file as expect.
I've tried the command inside the basic program; that too is not working.
It still goes to the printer.

What does work is a "PA" type process in the VOC that stacks the commands.
My problem there is I can't figure out how to make the 'HOLD NAME' something unique; date & time appended to name.
Any suggestions?

Tom Pellitieri

  • Rock Star
  • *****
  • Posts: 224
  • Tom Pellitieri - Toledo, Ohio
Re: Output to the HOLD file
« Reply #1 on: November 04, 2019, 09:48:28 am »
I wrote this subroutine years ago.  I call it from BASIC programs that need to change printer settings.

PROGRAM CEI.SETPTR
Code: [Select]
      SUBROUTINE CEI.SETPTR(MODE,QUEUE,COPIES,UID)
*
* Call SETPTR with the appropriate options
* MODE: 1=Print, 3=Hold/Suppress, 6=Hold/Print
* QUEUE: Print Queue   COPIES: Number of Copies
* UID:  ID tag for BANNER.  Make unique if UID ends in "-"
*
* Adjust parameters if needed.  Use MODE 3 if invalid.
* If no queue specified, use {default}, MODE 3.  Make certain
* we have a positive integer number of copies, and check
* for a BANNER UNIQUE request.
*
      MOD1 = 3
      Q = QUEUE
      CP = COPIES + 0
      UD = TRIM(UID)
      IF MODE = 1 THEN MOD1 = 1
      IF MODE = 6 THEN MOD1 = 6
      IF TRIM(QUEUE) = "" THEN MOD1 = 3 ; Q = "{default}"
      IF CP < 1 THEN CP = 1
      CP = INT(CP)
      IF MOD1 > 1 AND UD = "" THEN UD = "ZZZZ-"
      BU = 0
      IF UD[LEN(UD),1] = "-" THEN BU = 1 ; UD = UD[1,LEN(UD)-1]
      IF MOD1 = 3 AND MODE # 3 THEN BU = 1
*
* Set up the printer
*
      CMD = "SETPTR 0,133,65,0,0,":MOD1
      CMD = CMD:",NFMT,NOEJECT,NOMESSAGE,BRIEF,DEST ":Q
      CMD = CMD:",COPIES ":CP
      IF MOD1 = 1 THEN CMD = CMD:",NHEAD" ELSE
         CMD = CMD:",BANNER "
         IF BU THEN CMD = CMD:"UNIQUE "
         CMD = CMD:UD
      END
      EXECUTE CMD CAPTURING MSG RETURNING ERR
      RETURN

I also have two INCLUDE file, PTR.PUSH, and PTR.POP, to save and restore the existing printer settings.

INCLUDE PTR.PUSH
Code: [Select]
* Save current Form Queue assignment in ZZZSVQ
*
      ZZZSVQ = GETPTR(0)

INCLUDE PTR.POP
Code: [Select]
* Restore Form Queue assignment from ZZZSVQ
*
      EXECUTE "SETPTR ":ZZZSVQ:",BRIEF" CAPTURING ZMSG RETURNING ZERR

Typical usage would be:

INCLUDE MYPROGS PTR.PUSH
CALL CEI.SETPTR(3,"MYPRT",1,"MYHOLD")
EXECUTE "SORT MYFILE … LPTR" CAPTURING TXTOUT RETURNING ERROUT
INCLUDE MYPROGS PTR.POP


Hope this helps.