Discussion:
Adding an overlay to a copied spooled file in *AFPDS format
(too old to reply)
Klaas Keesman
2008-03-07 15:27:24 UTC
Permalink
I have got a problem and I don't know how to solve it. I like to copy
a spooled file to another outq and at the same time I like to add an
overlay to it with the text "COPY". This can be done when the spooled
file is in *SCS format (CPYSLF to workfile with *FCFC, OVRPRTF to
*AFPDS and FRONTOVL with the name of the overlay). But I have Spooled
files that are created by means of DDS and the output have a couple of
barcodes on it. These spooled files are in *AFPDS format. I found a
command / programs on the site of Craig Rudledge (JCRSPLF) that can be
used to copy a spooled file in *AFPDS format to another outq and that
is working fine. It gives the possibility to add an overlay to the
copied file. I put in the name of the COPY overlay but this overlay is
not printed.

So I had to look why this does not work. Using the DUMPSTER program of
GUMBO I am able to display the different components of the spooled
files. In Craig's program, the FRONTOVL is added to the spooled file
by means of changing the FRONTOVL value in the SPLA0200 format. But
that is not enough I think. I compared the buffers of a spooled file
that was generated with the COPY overlay attached to it, with the
spooled file that has been copied by means of the JCRSPLF command and
it shows me that page buffer of the first spooled file contains a
reference to the COPY overlay and this reference is missing in the
second spooled file although the COPY overlay is referenced in
Resource list.

Has anyone an idea how this problem can be solved? On our i5,
Infoprint Designer and Infoprint Server is installed.
Bradley V. Stone
2008-03-07 15:30:08 UTC
Permalink
IIRC while looking into this a while back I was told that AFPDS spooled
files cannot be modified as far as the overlay as the data/images from
the overlay is added at creation time.

You are correct that with SCS spooled file this can be changed, but I
believe you're out of luck with AFPDS.
Rodney A. Johnson
2008-03-07 19:53:44 UTC
Permalink
CHGSPLFA allows changing of the front and back overlay attributes under
certain conditions and does NOT allow changing of the front and back
overlay attributes under other conditions.

One condition under which the Front and Back overlay attributes cannot
be changed is for natively spooled AFPDS (i5/OS generated AFP spooled
files). The reason for this is because the attribute merely echos what
is present in the data stream of the spooled file. CHGSPLFA only
changes attributes (not data stream), and thus does not allow changing
of the front or back overlay.

To accomplish the task you desire, the data stream would need to be read
in, modified and respooled. The PrintManager/400 APIs work well for
data stream respooling. However, in order to get the newly spooled data
to print the same, one would have to respool a second time using
QSPCRTSP, QSPGETSP, QSPPUTSP, QSPCLOSP, QUSRSPLA, etc. to get the Native
AFP flag set to yes.

You could do it in one respool, however, then you have to respool the
modified data stream in the format that API QSPPUTSP accepts. After 13+
years maintaining and enhancing that i5/OS Spool function (including the
afore mentioned APIs), even I wouldn't waste effort against that
approach....way quicker to code and respool twice (and a lot less error
prown).

I know there are some thirdparty apps out there that perform data stream
manipulation...but I believe all those convert the data to some ascii
data stream and use existing tools to perform the merge and then respool
as userascii (usually PCL).
Post by Klaas Keesman
I have got a problem and I don't know how to solve it. I like to copy
a spooled file to another outq and at the same time I like to add an
overlay to it with the text "COPY". This can be done when the spooled
file is in *SCS format (CPYSLF to workfile with *FCFC, OVRPRTF to
*AFPDS and FRONTOVL with the name of the overlay). But I have Spooled
files that are created by means of DDS and the output have a couple of
barcodes on it. These spooled files are in *AFPDS format. I found a
command / programs on the site of Craig Rudledge (JCRSPLF) that can be
used to copy a spooled file in *AFPDS format to another outq and that
is working fine. It gives the possibility to add an overlay to the
copied file. I put in the name of the COPY overlay but this overlay is
not printed.
So I had to look why this does not work. Using the DUMPSTER program of
GUMBO I am able to display the different components of the spooled
files. In Craig's program, the FRONTOVL is added to the spooled file
by means of changing the FRONTOVL value in the SPLA0200 format. But
that is not enough I think. I compared the buffers of a spooled file
that was generated with the COPY overlay attached to it, with the
spooled file that has been copied by means of the JCRSPLF command and
it shows me that page buffer of the first spooled file contains a
reference to the COPY overlay and this reference is missing in the
second spooled file although the COPY overlay is referenced in
Resource list.
Has anyone an idea how this problem can be solved? On our i5,
Infoprint Designer and Infoprint Server is installed.
--
Rodney A Johnson
Technical Team Lead for i5/OS (AS/400) Spool
Dept GJC
IBM Rochester, Minnesota

The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, IBM. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.
Newbie_Neil
2008-03-08 08:18:39 UTC
Permalink
Hi Klaas

We use FormMagic and it creates two spool files, as follows: -

File User User Data Sts Pages Copies
Form Type Pty
FMGMULOVL USER DNT_Off_01 SAV 1* 1
*STD 5
DESP_NOTE USER DNT_Off_01 SAV 2 1
*STD 5

FMGMULOVL is the overlay for the despatch note (DNT) and DESP_NOTE
contains the detail with a little bit of PCL to tell the printer it
requires an overlay to be loaded.

This means that if an overlay changes it is a simple matter to
substitute the FMGMULOVL overlay.

Cheers,
Neil
Klaas Keesman
2008-03-13 13:12:17 UTC
Permalink
Post by Klaas Keesman
I have got a problem and I don't know how to solve it. I like to copy
a spooled file to another outq and at the same time I like to add an
overlay to it with the text "COPY". This can be done when the spooled
file is in *SCS format (CPYSLF to workfile with *FCFC, OVRPRTF to
*AFPDS and FRONTOVL with the name of the overlay). But I have  Spooled
files that are created by means of DDS and the output have a couple of
barcodes on it. These spooled files are in *AFPDS format. I found a
command / programs on the site of Craig Rudledge (JCRSPLF) that can be
used to copy a spooled file in *AFPDS format to another outq and that
is working fine. It gives the possibility to add an overlay to the
copied file. I put in the name of the COPY overlay but this overlay is
not printed.
So I had to look why this does not work. Using the DUMPSTER program of
GUMBO I am able to display the different components of the spooled
files. In Craig's program, the FRONTOVL is added to the spooled file
by means of changing the FRONTOVL value in the SPLA0200 format. But
that is not enough I think. I compared the buffers of a spooled file
that was generated with the COPY overlay attached to it, with the
spooled file that has been copied by means of the JCRSPLF command and
it shows me that page buffer of the first spooled file contains a
reference to the COPY overlay and this reference is missing in the
second spooled file although the COPY overlay is referenced in
Resource list.
Has anyone an idea how this problem can be solved? On our i5,
Infoprint Designer and Infoprint Server is installed.
Thanks everyone for your support.

I think I have solved my problem. During the creation of the *AFPDS
spooled file that has to be copied, I fill the FRONTOVL parameter with
the the name of a non existent overlay like DUMMYOVL. This reserves
the buffer space for the overlay in the spooled buffer. Then I do a
QSPGETSP (together with a QUSRSPLA, QSPCRTSP, etc) from the spooled
file to a userspace. Scan the userspace for DUMMYOVL and replace it
with the Overlay I wanted to add. Copy the userspace back to a new
spooled file with QSPPUTSP. And the overlay appears on the copied
spooled file.
Rodney A. Johnson
2008-03-14 19:47:39 UTC
Permalink
Post by Klaas Keesman
Post by Klaas Keesman
I have got a problem and I don't know how to solve it. I like to copy
a spooled file to another outq and at the same time I like to add an
overlay to it with the text "COPY". This can be done when the spooled
file is in *SCS format (CPYSLF to workfile with *FCFC, OVRPRTF to
*AFPDS and FRONTOVL with the name of the overlay). But I have Spooled
files that are created by means of DDS and the output have a couple of
barcodes on it. These spooled files are in *AFPDS format. I found a
command / programs on the site of Craig Rudledge (JCRSPLF) that can be
used to copy a spooled file in *AFPDS format to another outq and that
is working fine. It gives the possibility to add an overlay to the
copied file. I put in the name of the COPY overlay but this overlay is
not printed.
So I had to look why this does not work. Using the DUMPSTER program of
GUMBO I am able to display the different components of the spooled
files. In Craig's program, the FRONTOVL is added to the spooled file
by means of changing the FRONTOVL value in the SPLA0200 format. But
that is not enough I think. I compared the buffers of a spooled file
that was generated with the COPY overlay attached to it, with the
spooled file that has been copied by means of the JCRSPLF command and
it shows me that page buffer of the first spooled file contains a
reference to the COPY overlay and this reference is missing in the
second spooled file although the COPY overlay is referenced in
Resource list.
Has anyone an idea how this problem can be solved? On our i5,
Infoprint Designer and Infoprint Server is installed.
Thanks everyone for your support.
I think I have solved my problem. During the creation of the *AFPDS
spooled file that has to be copied, I fill the FRONTOVL parameter with
the the name of a non existent overlay like DUMMYOVL. This reserves
the buffer space for the overlay in the spooled buffer. Then I do a
QSPGETSP (together with a QUSRSPLA, QSPCRTSP, etc) from the spooled
file to a userspace. Scan the userspace for DUMMYOVL and replace it
with the Overlay I wanted to add. Copy the userspace back to a new
spooled file with QSPPUTSP. And the overlay appears on the copied
spooled file.
Be aware that the spooled file could exceed the maximum size of a user
space and will require that you have the ability to process multiple
user spaces (loop of call to QSPGETSP, update data stream, QSPPUTSP
until all end of file).

Be very careful that you don't interject extra bytes since that will
mess up the spool buffers and make a real mess of things. There are
probably other reason why this is a risky method, but can't think of any
off the top of my head. Good luck with your solution.
--
Rodney A Johnson
Technical Team Lead for i5/OS (AS/400) Spool
Dept GJC
IBM Rochester, Minnesota

The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, IBM. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.
Rodney A. Johnson
2008-03-14 20:52:13 UTC
Permalink
Post by Klaas Keesman
Post by Klaas Keesman
I have got a problem and I don't know how to solve it. I like to copy
a spooled file to another outq and at the same time I like to add an
overlay to it with the text "COPY". This can be done when the spooled
file is in *SCS format (CPYSLF to workfile with *FCFC, OVRPRTF to
*AFPDS and FRONTOVL with the name of the overlay). But I have Spooled
files that are created by means of DDS and the output have a couple of
barcodes on it. These spooled files are in *AFPDS format. I found a
command / programs on the site of Craig Rudledge (JCRSPLF) that can be
used to copy a spooled file in *AFPDS format to another outq and that
is working fine. It gives the possibility to add an overlay to the
copied file. I put in the name of the COPY overlay but this overlay is
not printed.
So I had to look why this does not work. Using the DUMPSTER program of
GUMBO I am able to display the different components of the spooled
files. In Craig's program, the FRONTOVL is added to the spooled file
by means of changing the FRONTOVL value in the SPLA0200 format. But
that is not enough I think. I compared the buffers of a spooled file
that was generated with the COPY overlay attached to it, with the
spooled file that has been copied by means of the JCRSPLF command and
it shows me that page buffer of the first spooled file contains a
reference to the COPY overlay and this reference is missing in the
second spooled file although the COPY overlay is referenced in
Resource list.
Has anyone an idea how this problem can be solved? On our i5,
Infoprint Designer and Infoprint Server is installed.
Thanks everyone for your support.
I think I have solved my problem. During the creation of the *AFPDS
spooled file that has to be copied, I fill the FRONTOVL parameter with
the the name of a non existent overlay like DUMMYOVL. This reserves
the buffer space for the overlay in the spooled buffer. Then I do a
QSPGETSP (together with a QUSRSPLA, QSPCRTSP, etc) from the spooled
file to a userspace. Scan the userspace for DUMMYOVL and replace it
with the Overlay I wanted to add. Copy the userspace back to a new
spooled file with QSPPUTSP. And the overlay appears on the copied
spooled file.
Thought about this some and discussed with colleague. Some things to
consider:
-always include a specific overlay name and have a blank version in the
library list of the original spooled file. When making copy, use a
library list that includes a version of the overlay with the "copy"
notation you desire. This option would eliminate the need to modify the
data stream.

-speaking of library lists, if you reference external resources in your
original spooled file, have a care when making a copy of the spooled
file, as those resources may not be found when respooling using the
APIs. Tricky subject with lots of pitfalls. I've probably discussed
such pitfalls previously in this newsgroup. Library list of copy is
inherited from job performing copy except if user has *SPLCTL and the
user specified in the copy is different then the current running user.
In exception case, the library list of the user is retrieved via the
values in the user's user profile/job description...won't apply any
library list changes via signon programs and such.

-If you ever have a need for a real front overlay in original spooled
file, going with a variation on the first item previously mentioned, you
could have two versions of the overlay...the production one, and one
that is the same but with the "copy" phrase added.

-if you should rely on library list type activity, be aware that this an
i5/OS unique item and thus your file isn't very transportable to another
platform supporting AFPDS (or mod:ca as its more properly identified).
--
Rodney A Johnson
Technical Team Lead for i5/OS (AS/400) Spool
Dept GJC
IBM Rochester, Minnesota

The contents of this message express only the sender's opinion.
This message does not necessarily reflect the policy or views of
my employer, IBM. All responsibility for the statements
made in this Usenet posting resides solely and completely with the
sender.
Loading...