Q
Problem solve Get help with specific problems with your technologies, process and projects.

Copy a spoolfile (report) into the IFS as a .txt file

I have copied a spoolfile to my PC manually using iSeries Navigator. And I've copied a database file to the IFS...

using the CPYTOIMPF command. So I suspect there must be a way to get the spoolfile to the IFS -- either manually or a command. When I try to drag it from the basic operations, printer output, it will not work. Is this a security issue? I looked for a command but did not find one.

You kind of answered your own question ... You can copy a spool file to a stream file but you have to move it to a DB file first!

Here's how I'd do it:

First create a database file like:

  CRTPF FILE(QTEMP/DBfile) RCDLEN(132)

Next copy the spool file into that database file:

 
        CPYSPLF FILE(MySpoolFile) TOFILE(QTEMP/DBfile)

Now that you have a database file, it is easily moved into the IFS like this:

 
         CPYTOIMPF FROMFILE(QTEMP/DBfile) 
            TOSTMF('/home/keg/MySpoolFile.txt') 
            STMFCODPAG(*STDASCII) RCDDLM(*CRLF) 
            DTAFMT(*FIXED)

More on this topic

The Best Web Links: tips, tutorials and more.

Ask your OS/400 questions -- or help out your peers by answering them -- in our live OS/400 discussion forums.

Ask the Experts yourself: Our OS/400 gurus are waiting to answer your questions.

Check out this Search400.com Featured Topic: 20 ways to ensure a smooth OS upgrade

 

 

This was last published in December 2004

Dig Deeper on Documentation

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close