× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 03-Mar-2015 07:38 -0600, Erwin Donker wrote:

Last week I was asked to have pdf documents that are stored on IFS
printed from a job on the iseries. After doing some research, I
found two possible solutions:

1. Using the command PRTSTMF, made by Scott Klement

2. Using QSH:
cat -c /pdf/test.pdf | Rfile -wbQ -c "OVRPRTF FILE(QSYSPRT) DEVTYPE(*USERASCII) OUTQ(MYOUTQ)" -C "DLTOVR FILE(QSYSPRT)" QSYSPRT

Option 1 works perfect (thanks Scott!). It generates a spoolfile on
the specified outq and the document gets printed as it should.

Option 2 (that should basically do the same IMO) also generates a
spoolfile on the specified outq, but when send to the printer results
in more than 100 pages with strange characters.

A third option might be to use a BINARY mode FTP with the PUT subcommand being used send the file data to a Printer File defined with the attributes noted in the override used in the above example of how the second option was coded; or the PrtF perhaps similarly overridden with the proper scoping to effect those attributes.

Even though I have decided to implement PRTSTMF in my application, I
am still curious as to why option 2 doesn't work for me. The only thing
I can think of is that somehow QSH converts the original data using my
job's CCSID. <<SNIP>>

As coded, both the cat utility [per -c] and the Rfile utility [per -b] are being told to treat the data as binary. Those should be able to be tested together or separately, and if spooling then verified using DEVTYPE(*SCS) to allow Display Spool File (DSPSPLF) or Copy Spool File (CPYSPLF) to verify the content on the IBM i rather than deferring to the recipient [e.g. the printer] to interpret the content.

What release? TR? Cumulative? I would first test separately, the results of both the 'cat -c' and the 'Rfile -b' to verify those switches for those utilities perform as expected.

The problem _could be_ with override scoping; for lack of explicit specification, the default is used for the Override Scope (OVRSCOPE) parameter for the Override With Printer File (OVRPRTF) command and the Level (LVL) parameter for the Delete Override (DLTOVR) command. Does the Work With Spooled File Attributes (WRKSPLFA) of the spooled QSYSPRT file, show that the spooled file was created with the specified-as overridden attributes, or perhaps the spooled file was not generated for *USERASCII, and that effect would mean that the DSPSPLF should be functional against the SPLF.?


2. What am I doing wrong in the QSH option? I have read on the net
that other people have used this option successfully...


FWiW the usage shown quoted above seems quite near identical to the 2nd Rfile example shown in the "Rfile - Read or write record files" documentation, showing the /same/ activity for a .PS file type instead of .PDF:
<http://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/rzahz/rzahzrfile.htm>
"...
2. Write the contents of stream file mydoc.ps to spooled printer device file QPRINT as unconverted ASCII data, and then use the CL LPR command to send the spool file to another system:

before='ovrprtf qprint devtype(*userascii) spool(*yes)'
after="lpr file(qprint) system(usrchprt01) prtq('rchdps') transform(*no)"
cat -c mydoc.ps | Rfile -wbQ -c "$before" -C "$after" qprint
..."


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.