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.
MKDIR DIR(‘/OUTQUEUEARCHIVE’)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.
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.
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:
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.
|&splnbr||Spooled file number (4-digits)|
|&splnbr2||Spooled file number (2-digits)|
|&usrdta||Spooled file user data|
|&splname||Spooled file name|
|&usrprf||Spooled file user profile|
|&jobnbr||Spooled file job number|
|&jobname||Spooled file job name|
|&outqname||Spooled file output queue name|
|&outqlib||Spooled file output queue library|
|&jobdate||Current job date|
|&sysdate||Current system date|
|&spldate||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.
Still have questions? We can help. Submit a case to Technical Support.