The Integrated File System (IFS) is the ideal location to store reports on the Power i. In this document we will examine how to accomplish this task manually using the Sequel companion product Esend.
The second part of this document will show you how you can automate the process using the forwarding functions available in Esend. Although we are looking at this process from a Sequel report point of view, you can easily apply these examples to any spooled output on the Power i.
Simple Archive Process to the IFS
- Create the folder(s) on the IFS to use as the warehouse for your spooled files (this process usually requires security officer level authority). To create a folder called 'OutQueueArchive' issue the fol- lowing command:
This creates the folder in the root of your Power i IFS directory. The IFS path to this location looks like: \\myiseries\outqueuearchive. This is the path you will specify as the destination for the any of the spooled files you want to copy (archive) from a given output queue to this folder on the IFS.
- Start Esend (GO ESEND/ESEND), and select option 6 to 'Copy Spool to IFS' (CPYSPLIFS). On the next screen you can tailor the command to use any spooled file(s) you choose and copy them to the IFS folder you specify. Use the directory created in the previous step by specifying ‘/outqueuearchive/filename.pdf’ for the 'To Stream File' (STMF) parameter. In the 'Spool Type' (TYPE) parameter, specify the format of the copied file, such as HTML or PDF. A command similar to the following is submitted:
SBMJOB CMD(CPYSPLIFS SPLF(QPJOBLOG) JOB(NUMBER/USER/JOBNAME) SPLNBR(1)
TYPE(*PDF) STMF(‘/OUTQUEUEARCHIVE/FILENAME.PDF’) REPLACE(*YES))
You can also schedule a nightly job to run the command to copy the files.
Automate Archiving with Esend Forwarding
You can automate this process by creating some simple ‘Archiving’ rules with the Esend Spool Forward feature. The process involves identifying the output queue or queues for archiving and specifying rules for selecting the specific spooled files to archive.
Once Esend forwarding is started, any spooled file arriving on a designated output queue will be checked against the rules set up for that output queue. If the spooled file meets the criteria of a forward- ing rule, the actions defined in that rule will be applied. The two steps that follow explain the process:
- Identify the output queues you want to archive using option 15 on the Esend menu. To be ar- chived, spooled files must arrive on the output queue released for printing. Output queues for archiving cannot be associated with an active printer.
- Identify rules for archiving files using menu option 14 to create the appropriate Forwarding Rules (below). Forwarding rules do two things. First, they select which spool files to be processed, and second they specify the specific handling for the selected spool files.
Spool File Selection
Forwarding rules can be specified with varying degrees of selectivity. The simplest rule will auto- matically include all spool files. If necessary, spool files can be selected based on any combination of the following values: spool file name, job name, user profile, form type and user data. Leave the selection values blank to include all spool files.
Spool File Archiving
Archive processing is defined in the ‘action’ (Send to) part of the rule. One type of ‘Send to’ specification supports a simple copy of the spool file to the IFS. Copy to IFS is indicated by enter- ing ‘ifs: ’ in lower case letters at the beginning of the Send to field. The string following ‘ifs: ‘ is the path and file name that the spool file is written to.
Esend forwarding rules can use any of the following variables to make the rule dynamic or the output unique. When a forwarding rule is applied, the variable portions of the rule are replace with the value indicated by the variable.
||Spooled file number (4-digits)
||Spooled file number (2-digits)
||Spooled file user data
||Spooled file name
||Spooled file user profile
||Spooled file job number
||Spooled file job name
||Spooled file output queue name
||Spooled file output queue library
||Current job date
||Current system date
||Spooled file date
So, if you’re archiving several different output queues, but you want to sort the archived files into fold- ers based on the user name, you would use &usrprf as part of the CPYSPLIFS command as part of the rule definition.
Notice in the example above, in the Send to field, we used multiple variables to concatenate and create a unique file name in the ‘outqueuearchive’ folder.