Solved

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

Posted on 2013-10-23
5
348 Views
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.

thanks
0
Comment
Question by:djb387
  • 2
5 Comments
 

Author Comment

by:djb387
Comment Utility
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
 
LVL 27

Accepted Solution

by:
tliotta earned 500 total points
Comment Utility
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
 
LVL 27

Expert Comment

by:tliotta
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 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