• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 691
  • Last Modified:

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

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.

thanks
0
djb387
Asked:
djb387
  • 2
1 Solution
 
djb387Author Commented:
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.
0
 
tliottaCommented:
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 )

   return

endpgm

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.

Tom
0
 
tliottaCommented:
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.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now