Solved

"Estimated" pages on a spooled file

Posted on 2013-01-31
5
240 Views
Last Modified: 2014-12-23
Hi,

I am creating an iSeries spooled file (SPLF) by copying a stream file into a *USERASCII print file. I can override several details on the print file so that we can find the relevant spooled file when needed (thanks to some of Scott Klement's code from years back.)

The options requested by most users relating to these spooled files are a way to see the spooled file text from the iSeries and a way to see a good estimate for the SPLF's number of pages on the WRKOUTQ and/or WRKSPLF screens.

I don't think I can do anything about viewing the file (because the stream file is ASCII postscript containing mostly binary images) but I can calculate the number of pages when I create the stream file, so I might be able to change the number of pages on the spooled file. How can I put the estimated number of pages onto the spooled file when I create it? (OVRPRTF does not help here, as far as I can see.)

Can anyone help? I am using an iSeries v6r1 machine with RPGLE and CLLE, although I also have access to Java if required.


-Paul.
0
Comment
Question by:Paul-Bailey
  • 2
5 Comments
 
LVL 34

Expert Comment

by:Gary Patterson
Comment Utility
You can put a page count for a ASCII spooled file in USRDTA (shows on WRKSPLF), USRDFNOPT, or USRDFNDTA.  USRDTA shows on WRKSPLF.  The last two need to be displayed from WRKSPLF option 8 or using WRKSPLFA.

I don't know of any way to directly view a rendered postscript in a green-screen session, but you could certainly write a program that would convert it to PDF and push it to an IFS share where the users PC can open it with Adobe Reader:

Basic process:

1) Dump the ASCII spooled file to a stream file (CPYSPLF to db file, then CPYTOSTMF to an IFS file.)

2) Convert PS to PDF using your favorit tool.  I've successfully used Ghostscript in PASE in the past.  Output the PDF to an IFS file share that is accessible to the user from their PC.   See links for more info.

3) Use STRPCCMD CL command to start adobe reader and open the PC file:

STRPCO
STRPCCMD PCCMD('start q:\pdfs\pdf_file_name.PDF')

http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Q_25273828.html

http://www.hewhocutsdown.net/blog/2012/04/25/how-to-compile-ghostscript-for-pase

http://www.mcpressonline.com/forum/showthread.php?17923-Printing-PDF-documents-from-the-IFS

http://www.scottklement.com/archives/ftpapi/200903/msg00083.html

Post back of you need more details.

- Gary Patterson
0
 

Author Comment

by:Paul-Bailey
Comment Utility
Thanks Gary. Most of that is a bit esoteric, but hopefully someone is now going to get a lot of help having those links all in the same place. Unfortunately, the CPYSPLF option doesn't work. I'm afraid I forget the exact error message (I am not at work atm) but the meaning of the message is about the same as the error for trying to display the spooled file.

We are already using the USRDTA and USRDFNDTA for other data fields, but I hadn't thought of USRDFNOPT (or, actually, I hadn't noticed it.)

I'll check that as soon as I can, but does this mean that I can't change the "estimated" total pages for one of these spooled files? The iSeries claims it is estimated, but it always estimates one page which is really pointless. I can't find the option on the OVRPRTF command, so is there some other command or API that might be able to change that value?



-Paul
0
 
LVL 34

Accepted Solution

by:
Gary Patterson earned 500 total points
Comment Utility
Native spool management doesn't "speak" postscript, so it has no idea by looking at content if a given spooled file represents one page or a thousand, based solely on content.  So for *USRASCII spooled files, it "Estimates" one page.

I don't know of a way (command or API) to change the "Number of Pages" attribute.  

I know that there is a "Total Number of Pages" attribute when using the QSPCRTSP api to create a spooled file.  Maybe you could alter the program that creates the file to use QSPCRTSP , QSPPUTSP, and QSPCLOSP (Create, Put, Close Spooled File) APIs to create the postscript file instead of whatever method you are currently using.  Then you could specify the correct page count yourself.
 
*USRASCII ASCII spooled files are a little tricky to work with.  The trick is getting the raw ASCII postscript dumped out.  Since CPYSPLF apparently doesn't like *USRASCII files (seems a silly limitation), you'd have to use the QSPGETSP API to grab and dump the raw ASCII Postscript instead.  

Once you have that, it is all downhill from there.  

Like I said, there are a lot of ways to do this, but all have similar complexities.

- Gary Patterson
0
 
LVL 14

Expert Comment

by:daveslater
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
A procedure for exporting installed hotfix details of remote computers using powershell
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now