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
Solved

"Estimated" pages on a spooled file

Posted on 2013-01-31
5
260 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 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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
Driver Where can I find IBMDA400 driver software 5 2,815
AS400 CPU allocation 3 111
vmware on IBM X3960 with HA - Idiots Guide 8 121
iSeries, AS/400 GUI 9 152
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

856 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