× 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 Thu, 19 Sep 2002, Wills, Mike N. (TC) wrote:

> Sure... I can get more ideas then.

Okay, but I warned you it was ugly.

First some explanation.  We wanted to achieve the following:

1. Only run the print-generating program once.  That way any program could
have "Page N of X" on the printout and the printout could be produced any
number of times.
2. Use the same spoolfile for the end result as that which we started with
(IOW update in place).  This preserves all the spool file attributes as
the original and prevents bugs that could occur by changing the
attributes.

Thinking on it now though it seems that we were unable to achieve goal 2.
But the code follows and we shall soon see.  Note that we used and
modified code we obtained from another source (online and with permission,
but I forget where now - the original author is probably on this list -
thank you!).

The programs work by searching for the characters '~~~~' in the printout.
This is lame because '~~~~' could be valid output.  Be we had to do
something...

After creating the printout the programs (whatever they may be) call the
CLP program PAGENOFXC passing the spoolfile and outq as parameters.  The
source to PAGENOFXC is at:

http://www.chowhouse.com/~james/pagenofx/PAGENOFXC

PAGENOFXC runs (among others) two commands to do the processing:
PAGENOFX and SPLRTVSPLF.  Those commands are at:

http://www.chowhouse.com/~james/pagenofx/PAGENOFX
http://www.chowhouse.com/~james/pagenofx/SPLRTVSPLF

PAGENOFX runs program RTVSPLFR to retrieve the spooled file into a user
space and modify the '~~~~' into the total number of pages.  The source
for that and the associated copy members and modules are at:

http://www.chowhouse.com/~james/pagenofx/RTVSPLFR
http://www.chowhouse.com/~james/pagenofx/SPLFAPI
http://www.chowhouse.com/~james/pagenofx/SPLFAPICPY
http://www.chowhouse.com/~james/pagenofx/SPCAPI
http://www.chowhouse.com/~james/pagenofx/SPCAPICPY

SPLRTVSPLF runs program SPLRTVSPLR to respool the modified printout.  The
source for that and all the related copy members and modules are at:

http://www.chowhouse.com/~james/pagenofx/SPLRTVSPLR
http://www.chowhouse.com/~james/pagenofx/OBJAPI
http://www.chowhouse.com/~james/pagenofx/OBJAPICPY

Again, almost all of this code was written by someone else (who am I sure
will recognize it).  I only made very small modifications to fit our
purpose.

Note that a bug occurs if the '~~~~' characters appear on a 1024 byte
boundary.  This particular implementation isn't all the good because of
this.

If I had to do it again I would have the printed output converted to a PDF
file by using scs2pdf (part of the tn5250 package) and then using a C
program to modify the PDF to put the page headings on each page.  I like
this approach because a PDF file tells you how many pages are in the
document and PDFs are easy to parse.  The hitch with this approach is that
scs2pdf doesn't handle IPDS printouts.  But now you can archive things
much better because you can view the archives on almost every platform
(OS/400 being a notable exception).  Showing these on the web becomes
simple, also.  And faxing becomes a breeze since a PDF is so easily
converted to postscript or TIFF.

James Rich



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.