Solved

"Estimated" pages on a spooled file

Posted on 2013-01-31
5
291 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 35

Expert Comment

by:Gary Patterson
ID: 38840872
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
ID: 38840934
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 35

Accepted Solution

by:
Gary Patterson earned 500 total points
ID: 38841698
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
ID: 40514556
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Getting to know the threat landscape in which DDoS has evolved, and making the right choice to get ourselves geared up to defend against  DDoS attacks effectively. Get the necessary preparation works done and focus on Doing the First Things Right.
This article outlines the struggles that Macs encounter in Windows-dominated workplace environments – and what Mac users can do to improve their network connectivity and remain productive.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

626 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