Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Copy Spooled File to Physical File and Back

1,374 views
Skip to first unread message

jen...@my-deja.com

unread,
Jul 24, 2000, 3:00:00 AM7/24/00
to
I am trying to copy a spooled file to a physical
file for storage, but then I want to copy it back
to a spooled file for e-mailing and printing. I
can do this, but when the physical file is copied
back to the spooled file, all editing is lost.
Does anyone have any tips?

Thanks,
Jennifer


Sent via Deja.com http://www.deja.com/
Before you buy.

jmatt...@my-deja.com

unread,
Jul 24, 2000, 3:00:00 AM7/24/00
to
A possible solution to your problem is:

When you CPYSPLF to disk, use the CTLCHAR (*FCFC) parameter. That will
put the Control character in position 1.

When you copy the physical back to spool use OVRPRTF with CTLCHAR
(*FCFC).

I'm not clear what "all the editing" includes.

Hope this helps.

Jim Mattheiss

In article <8lhmqt$pd0$1...@nnrp1.deja.com>,

jen...@my-deja.com

unread,
Jul 24, 2000, 3:00:00 AM7/24/00
to
Thank You.

I had tried that, but what I missed was to make the record length of
the physical file only 1 character longer (no more, no less) than the
width of your spooled file.

Now, I'm looking to copy more than one member of a physical file to 1
spooled file. So far, what I've read hasn't been positive. Has anyone
had any luck with this?

Thanks,
Jennifer


In article <8li0v7$1tl$1...@nnrp1.deja.com>,

Thomas Kine

unread,
Jul 24, 2000, 3:00:00 AM7/24/00
to
I believe you want OPTION(*PRTCTL) on the CPYSPLF command in order to
preserve the line spacing, etc. when you put back to spooled file.

Worley Barry

unread,
Jul 24, 2000, 3:00:00 AM7/24/00
to
On Mon, 24 Jul 2000 15:20:03 GMT, jen...@my-deja.com wrote:

>I am trying to copy a spooled file to a physical
>file for storage, but then I want to copy it back
>to a spooled file for e-mailing and printing. I
>can do this, but when the physical file is copied
>back to the spooled file, all editing is lost.
>Does anyone have any tips?
>

1. Define the physical file one character longer than the
spoolfile line.

2. Specify CTLCHAR(*FCFC) on the copy spoolfile command

3. Override the printer file to CTLCHAR(*FCFC) before you copy
the physical file to it.

Regards, Worley

Njål Fisketjøn

unread,
Jul 24, 2000, 3:00:00 AM7/24/00
to
On Mon, 24 Jul 2000 20:19:11 GMT, jen...@my-deja.com wrote:

>Now, I'm looking to copy more than one member of a physical file to 1
>spooled file. So far, what I've read hasn't been positive. Has anyone
>had any luck with this?

Two possible solutions (not tested)

- Ovrdbf with mbr(*all) before you copy from it
- Copy all other memmbers to the first member with mbropt(*add) before
copying to the spoolfile


Njål Fisketjøn, FIGU DATA AS
n...@figu.no

Jim Thedorf

unread,
Jul 25, 2000, 3:00:00 AM7/25/00
to
The way I prefer is to install the System36 part of the OS400 and use the
COPYPRT command. This command retains all attributes.


Jim Thedorf

<jen...@my-deja.com> wrote in message news:8lhmqt$pd0$1...@nnrp1.deja.com...


> I am trying to copy a spooled file to a physical
> file for storage, but then I want to copy it back
> to a spooled file for e-mailing and printing. I
> can do this, but when the physical file is copied
> back to the spooled file, all editing is lost.
> Does anyone have any tips?
>

Maxime Allegro

unread,
Aug 3, 2000, 3:00:00 AM8/3/00
to
QSPGETF AND QSPPUTF APIs AND COMMANDS
IBM Knowledgebase item 8011926 describes two APIs that are
undocumented in the AS/400 manuals. The two APIs, Get Spooled File
(QSPGETF) and Put Spooled File (QSPPUTF), copy spool files to and
restore them from physical files, respectively. The advantage of
QSPGETF and QSPPUTF over the well-documented Copy Spooled File command
(CPYSPLF) is that the APIs are able to copy Advanced Function Printing
Data Stream (AFPDS) and Intelligent Printer Data Stream (IPDS) spool
files, whereas CPYSPLF cannot.

You can call the QSPGETF and QSPPUTF APIs directly, or you can call
them using command wrappers over the APIs.

a. Calling the APIs Directly
The QSPGETF API call below saves spool file QPRINT to database file
SPOOLDB in USER1LIB library, member MBR1, where the spool file number
is 1 and the spool file job is 010160/user1/dsp03:

CALL PGM(QSYS/QSPGETF) PARM('QPRINT ' 'SPOOLDB USER1LIB ' +
'DSP03 USER1 010160' X'0001' 'MBR1 ')

The QSPPUTF API call below creates a spool file in USER1 output queue
in QGPL library from the MBR1 member in the SPOOLDB database file:

CALL PGM(QSYS/QSPPUTF) PARM('SPOOLDB USER1LIB ' 'USER1 QGPL ' 'MBR1 ')

b. Calling the APIs from command wrappers
The two calls below correspond to the examples above, but these
examples use the command calls instead of calls directly to the APIs:

GETSPLF FILE(QPRINT) TOFILE(USER1LIB/SPOOLDB) +
JOB(010160/USER1/DSP03) SPLNBR(1) TOMBR(MBR1)

PUTSPLF FROMFILE(USER1LIB/SPOOLDB) OUTQ(QGPL/USER1) +
FROMMBR(MBR1)

Although the QSPGETF and QSPPUTF APIs are included in every OS/400
release since V3R2, the commands are not included. Fortunately, you
can obtain the compiled commands and the command source code from the
Knowledgebase item, which can be found at

http://as400service.ibm.com/8625680A007CA5C6/0/10AFE2F98C7F5FB9862565C2007D46A8?Open&Highlight=2,8011926
.

This item was adapted from IBM Knowledgebase item 8011926

Peter R Rowley

unread,
Aug 3, 2000, 3:00:00 AM8/3/00
to
And that reply should have been attributed to the lovely News/400
programmer tips n' techniques newsletter that was emailed out
yesterday/today.

After all you get it for free, the least they deserve from you is the
credit for the info.

Peter

============================================


In article <3989699D...@ti-informatique.com>,

Kevin Vette

unread,
Aug 3, 2000, 3:00:00 AM8/3/00
to
Maxime Allegro wrote:

This knowledgebase item is not completely accurrate. These are NOT apis. They are service tools that were
put out to help get spooled files in from customers for APAR purposes. That is why they are not documented
in the API manuals. They are also not supported as APIs. They are user beware and in fact there are known
problems with them that are not going to be fixed so use them at your own risk. IBM does supply the
QSPOPNSP, QSPGETSP, QSPPUTSP, and QSPCLOSEP APIs which are supported and can be used to save off spooled
files.

--
Kevin Vette
AS/400 Spool/Print
IBM Rochester, Minnesota
Comments provided "as is" - no warranties provided


Charles R. Pence

unread,
Aug 3, 2000, 3:00:00 AM8/3/00
to
Maxime Allegro wrote:
> QSPGETF AND QSPPUTF APIs AND COMMANDS
> IBM Knowledgebase item 8011926 describes two APIs that are
> undocumented in the AS/400 manuals. The two APIs, Get Spooled File
> <<SNIP>>

Do not use these programs as APIs; they are not APIs.
http://www.deja.com/[ST_rn=ps]/getdoc.xp?AN=512752086&fmt=text

Regards, Chuck
All comments provided "as is" with no warranties of any kind whatsoever.

0 new messages