Copy/move spool files from a print queue to the IFS

Posted on 2013-10-23
Last Modified: 2016-07-10
Wondering if someone can point me in the right direction. I have several spool files in an outq  called P5 that a user would like transferred to a folder called Audit 2013 in the IFS.  I am looking through the System I Navigator client but cannot find a way to copy or move these files.  Drag/drop does not work,  nor am I able to Copy/Paste. Is there another way to do this?

I am using System I Navigator V7R1 Mod 0.

Question by:djb387
  • 2

Author Comment

ID: 39598260
A little more information:   This is regarding System I  operating system for the IBM I series, also known as the AS/400.  Any help would be greatly appreciated.
LVL 27

Accepted Solution

tliotta earned 500 total points
ID: 39881825
Sorry for not seeing this sooner, but it was under "Mainframe" topics rather than one of the AS/400 topics. (Now, since the "AS/400" topics have inexplicably been reclassed under "Mainframe", I stumbled onto it.)

Do you have a solution?

Two fairly simple possibilities come to mind.

iSeries Navigator doesn't seem to have a directly implemented method of drag/drop from output queue to IFS directory. However, drag/drop can be done to a Windows folder on a PC. And if that Windows folder represents a network shared directory that is physically an IFS directory, the actual result is a copy in the IFS directory on the server. One technical problem is that the spooled file EBCDIC character encoding is converted to the Windows default encoding, which is probably CCSID 1252. That might not be a problem if PC access is the intended objective, but it can cause possible confusion for iSeries programs.

Also, if a programmed solution on the iSeries is needed, the QShell catsplf utility can be a handy shortcut. Here's a cheap way to interface to it:

A command shell:
             CMD        PROMPT('Copy SplF to IFS text file')

             PARM       KWD(JOB) TYPE(QJOB) DFT(*) SNGVAL((*)) +
                          PROMPT('Job name' 2)

             PARM       KWD(SPLF) TYPE(*NAME) LEN(10) MIN(1) +
                          EXPR(*YES) PROMPT('Spool file name' 1)

             PARM       KWD(SPLNBR) TYPE(*DEC) LEN(5) PROMPT('Spool +
                          file number')

 QJOB:       QUAL       TYPE(*NAME) LEN(10) MIN(1) EXPR(*YES)
             QUAL       TYPE(*NAME) LEN(10) MIN(0) EXPR(*YES) +
                          PROMPT('User name')
             QUAL       TYPE(*CHAR) LEN(6) RANGE(000001 999999) +
                          MIN(0) FULL(*YES) PROMPT('Job number')

Open in new window

A CPP for the command:
pgm    ( +
         &pqJob       +
         &pSplFnam    +
         &pSplNbr     +

   dcl   &pqJob       *char    26
   dcl   &pSplFnam    *char    10
   dcl   &pSplNbr     *dec  (   5 0 )

   dcl   &job         *char    28     value( ' ' )
   dcl   &splNbr      *char     5     value( ' ' )

   dcl   &cmd         *char   128     value( ' ' )

   chgvar             &job           ( %sst( &pqJob 21  6 ) *cat  '/' *cat +
                                       %sst( &pqJob 11 10 ) *tcat '/' *cat +
                                       %sst( &pqJob  1 10 ) +
   chgvar             &splNbr                &pSplNbr

   chgvar             &cmd           ( 'touch -C 1252 mysplftxt.spl && +
                                       catsplf -j' *bcat &job *tcat ' ' *cat +
                                       &pSplFnam *bcat &splNbr *bcat +
                                       '>mysplftxt.spl' +

/* Example: */
/* qsh cmd('touch -C 819 mysplftxt.spl && +
            catsplf -j 987654/myuser/myjob  mysplf 3 >mysplftxt.spl' ) */

   strqsh      cmd( &cmd )



Open in new window

The CL program will copy the spooled file to the job user's current directory into a streamfile named "mysplftxt.spl". Changes can be made to generate that name in any way desired, or a specific path could be set. The streamfile is first set to CCSID 1252 though you might prefer 819 (simpler ASCII) or something else.) This is just an example command I created to do some temporary work a while ago.

There are, of course, true 'third' alternatives. Detailed programming can be created on the iSeries to read spooled file data and write it to a streamfile. Similarly, PC programming can be created using iSeries Access APIs or the Java Toolkit to process spooled files. If those are actually needed, they'll be more complex.

For all of the alternatives, the target can be a physical IFS streamfile or a streamfile in some shared directory in your network.

By registering a UIM Spooled File User-defined List Action Exit Program, various system displays (e.g., WRKSPLF) could send spooled files to a program that implements a command based on the above example. A couple changes to the example CL would allow creating a new streamfile for each spooled file.

None of this makes much difference if you already have a solution. Maybe something will help, or maybe other members might see a useful piece.

LVL 27

Expert Comment

ID: 41702063
I'll object even though it's not clear what solution the OP actually needs. The iNavigator suggestion will work if that's the actual desired interface. The other suggestions will also work in other cases. Best ways to make any of them work could have been laid out if the OP had replied with more info.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
This is about my first experience with programming Arduino.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now