Solved

"Estimated" pages on a spooled file

Posted on 2013-01-31
5
277 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help needed with DCM certificate renewal 9 378
Driver Where can I find IBMDA400 driver software 5 3,342
Find Date Difference in AS400 Query 11 587
AS/400 Backup to Disk 7 593
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

752 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