Author Topic: /RD how do you force output to HOLD file  (Read 5384 times)

DonQuixote

  • Rock Star
  • *****
  • Posts: 205
  • To Dream the Impossible Dream...
/RD how do you force output to HOLD file
« on: March 04, 2015, 11:33:37 AM »
In the report writer (/RD) how do you force output to the HOLD file with a specific name for the output.
I need this report in GRIM so that I can schedule this job but I need the output to be a name other than the default.
Any Advice?

Tom Pellitieri

  • Rock Star
  • *****
  • Posts: 224
  • Tom Pellitieri - Toledo, Ohio
Re: /RD how do you force output to HOLD file
« Reply #1 on: March 05, 2015, 06:48:59 AM »
Most of our GRIM reports use a paragraph to set up additional selection criteria before executing the report.  I wrote a subroutine to execute the SETPTR command to put the job on hold to a specific name.  The paragraph effectively has:

CALL MY.SETPTR("MYPTR","MYJOB")
EXEC "R*FILENAME*MY.REPORT"

MY.SETPTR executes the following TCL command:

SETPTR 0,133,65,0,0,3,NFMT,NOEJECT,NOMESSAGE,BRIEF,DEST MYPTR,COPIES 1,BANNER MYJOB

(Edit: Of course, MYPTR and MYJOB in the command are from the parameters passed to the subroutine)

This ALWAYS saves the output of my report to MYJOB in the HOLD file.

--Tom
« Last Edit: March 05, 2015, 06:50:50 AM by Tom Pellitieri »

DonQuixote

  • Rock Star
  • *****
  • Posts: 205
  • To Dream the Impossible Dream...
Re: /RD how do you force output to HOLD file
« Reply #2 on: March 05, 2015, 11:57:39 AM »
I understand the SETPTR command in the paragraph and to execute it before going to the report writer;
But the report writer still ask for the output options.   
Should I remove the OUTPUT.REDIRECT in the report?

Tom Pellitieri

  • Rock Star
  • *****
  • Posts: 224
  • Tom Pellitieri - Toledo, Ohio
Re: /RD how do you force output to HOLD file
« Reply #3 on: March 06, 2015, 06:34:47 AM »
If you know you're only going to print the report to the _HOLD_ file, you should change the Output Options in the /RD F6 screen from A (Ask at Runtime) to P (Print).

You don't need to drop the OUTPUT.REDIRECT.

--Tom

DonQuixote

  • Rock Star
  • *****
  • Posts: 205
  • To Dream the Impossible Dream...
Re: /RD how do you force output to HOLD file
« Reply #4 on: March 06, 2015, 12:04:49 PM »
I followed your directions to the letter.
Still no luck.  It brings up the standard SB+ printer request and I give it the standard answers.  stationery TOFILE and options HS.

and the hold file name is generated and not the one I indicated.

Tom Pellitieri

  • Rock Star
  • *****
  • Posts: 224
  • Tom Pellitieri - Toledo, Ohio
Re: /RD how do you force output to HOLD file
« Reply #5 on: March 09, 2015, 02:24:03 PM »
Just to confirm:

1) You're using a Paragraph to get GRIM parameters (e.g., EXEC "GRI.ENT")
2) You're calling a subroutine to run SETPTR just before EXEC "R*FILE*RPT"
3) In your Report Parameters (/RD F6), Output Device is "P"
4) In the Additional Report Parameters (/RD F6 F6), you at most have:
  a) Process After Exec "REPORT.CLOSE"
  b) Output Redir Process "OUTPUT.REDIRECT" (optional parameter: ",E")

That's all we use here, and it works. 

You can confirm that the SETPTR is working by using this BASIC debug:

EXEC "SETPTR 0,etc."
TMP = GETPTR(0)
CALL SB.DISP(3,TMP)

This should display the parameters needed for the SETPTR command to set Printer Unit 0 to the current settings (i.e., the ones you just executed).

--Tom

DonQuixote

  • Rock Star
  • *****
  • Posts: 205
  • To Dream the Impossible Dream...
Re: /RD how do you force output to HOLD file
« Reply #6 on: March 10, 2015, 04:49:53 PM »
I tried it again from scratch. Verifying everything in your list.
Still does NOT work.

Do you get a SB+ popup box asking for the printer?  I do.


Tom Pellitieri

  • Rock Star
  • *****
  • Posts: 224
  • Tom Pellitieri - Toledo, Ohio
Re: /RD how do you force output to HOLD file
« Reply #7 on: March 11, 2015, 07:59:47 AM »
We only run these reports as Phantom jobs on the weekend.  In those jobs, we set the printer destination to our main printer, hold and suppress.

Unfortunately, I can't go back and run these jobs separately without messing things up for our staff.  We repost data from multiple sources (open sales and purchase orders, on hand inventory, etc.) and the reports summarize the information for them on a weekly basis.

What "doesn't work" in your process?

--Tom

DonQuixote

  • Rock Star
  • *****
  • Posts: 205
  • To Dream the Impossible Dream...
Re: /RD how do you force output to HOLD file
« Reply #8 on: March 11, 2015, 08:05:52 AM »
The report goes to the HOLD file.
What does not work is the setting of the NAME of the hold file.
Even though I set the name using the SETPTR command the report gets the standard name based on my login.