[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2013-10-23
5
Medium Priority
?
651 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 

Author Comment

by:djb387
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.
0
 
LVL 27

Accepted Solution

by:
tliotta earned 2000 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 )

   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
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.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
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…

649 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