OnDemand Users Group

Support Forums => CMOD for i => Topic started by: mikebee49 on August 05, 2009, 01:28:13 PM

Title: Printing with Common Server
Post by: mikebee49 on August 05, 2009, 01:28:13 PM
Hi,

With Spool File Archive, we used the command FNDKEYRDAR, and in the "OUTPUT" parameter we specified "*PRINT" to print the segment or full report. In Common Server, there is no "OUTPUT" parameter with command FNDKEYOND. The command PRTRPTOND prints the full report, not segment. I don't want to open the OnDemand client every time a user prints a segment/report. Any solutions?

Also, when I print the segment/report from the OnDemand Client, it prints a blank page, even though I have data on my screen.

Thanks!

Mike
Title: Re: Printing with Common Server
Post by: Joe Wolken on August 05, 2009, 02:08:05 PM
I would suggest that you try the QSHELL command: ARSDOC PRINT
This command includes:
-f parameter for a folder name
-i parameter for an SQL query string (this should enable you to narrow to a specific segment)
-P parameter for a system printer

Type QSH at the command line to get a QSHELL command line. Then type ARSDOC PRINT and press Enter to get a list all of the parameters.

Good luck,
Joe
Title: Re: Printing with Common Server
Post by: mikebee49 on August 06, 2009, 03:31:17 PM
Thanks Joe! I've tried it "on the side" and it will work.

I do have another question. With FNDKEYRDAR, it created a spool file of the segment/report. I don't have a spool file with FNDKEYOND. Is it possible to generate one?

Thanks!
Title: Re: Printing with Common Server
Post by: Joe Wolken on August 06, 2009, 05:07:07 PM
Appendix A of the OnDemand Common Server v.5.4 Admin Guide says that the FNDKEYOND command is "intended as an API to launch the OnDemand Client from a green screen application".  I do not think that IBM provided the ability to create a spool file of the segment/report using this API.

Good Luck,
Joe Wolken
Title: Printing with Common Server
Post by: soniab on November 12, 2009, 08:51:20 PM
I have a problem with the api ARSDOC PRINT. 

Example: qsh cmd('arsdoc print -f INVOICES -h ONDTEST -v -i "WHERE F_05 = ''999999' '" -P P810DE02L')

INVOICES is the folder name.
ONDTEST is the instance name.

When I execute the api, a job QP0ZSPWP is submitted in Batch for user ONDTEST. A spool is producted in the output queue P810DE02L for job QP0ZSPWP, user ONDTEST.

But I can have 10 requests in same time. How I can retrieve the spool produced by my original job?

Thank in advance for your assistance.

Sonia  ???
 


Title: Re: Printing with Common Server
Post by: mpavel on January 26, 2010, 03:06:08 PM
Had to fight that battle already.  Since Common Server prints thru QSHELL (as Joe mentioned above), only option is to control the Output Queue it is sent to (on ARSDOC Print command), and monitor that queue (using Data Queues & a program).  When it shows up, you have to decide what to do with it.  We have an application that will Fax/Email documents from Common Server:
--Multiple programs drop records into a file for request to print.
--Program 1 reads a record from that file, and requests the document to print, and waits. 
--QShell does it's thing, the document shows up in the Outq, and an entry is placed in the Data Queue.
--Program 2 reads the Data Queue, and reads the spool file for the key information we use to pull it
   (Invoice #, Customer #), and writes an entry to a second Data Queue (keys, spoolfile ID, Job ID)
--Program 1 reads that Data Queue, checks to see if it is the correct Document type (Invoice), and if
   the keys match (Invoice #, Customer #), continues to process the spoolfile (fax or email, or
   could even print)

SFA was much easier !  But since every print request is submitted, you can't track it directly.

Also, we only do this with documents that came from spool files--scanned documents will not print to an outq, they must go to the IFS, but we haven't gotton that far (but how difficult can that be !).

Hope it helps.