Background

Spooled File Archiving: As an IBM i (AS/400, iSeries) site, you may be sitting on tens of thousands of historic Spooled File reports. Some of these may be important financial documents, such as statements and invoices. Others may be financial or operational reports. All of these Spooled Files are occupying disk space on your server, and are stored in a way that does not make it easy to search for a particular report.

What you need are tools that allow you to archive your Spooled File reports to an offline storage solution which supports structured indexing of documents.

IBM Content Manager OnDemand is a powerful tool that allows you to archive and index documents. While it is a multi-platform solution, IBM Content Manager OnDemand includes IBM i commands that allow native archiving of IBM i Spooled Files.

CoolSpools is a powerful IBM i tool that provides functionally-rich Spooled File automation and allows you to convert and distribute Spooled Files and IBM i database tables in multiple file formats, including:

  • Excel
  • PDF
  • Delimited text (e.g. CSV)
  • HTML
  • XML

Using these two powerful IBM i tools together allows you to easily archive your reports, either as a native IBM i Spooled File or converted to another document format such as Excel or PDF.

Archive Spooled Files Natively

Once IBM Content Manager OnDemand is configured, archiving Spooled Files is a simple task, but you can integrate this archiving with other Spooled File automation using CoolSpools.

The CoolSpools Admin module allows you to create scripts that process one or more actions on a Spooled File – these actions can include CoolSpools converter commands or any IBM i system command. In order to archive a Spooled File to OnDemand, you can include a step within a script to move the spooled file to another Output Queue that is monitored by OnDemand, or add a step to run the OnDemand command ADDRPTOND to add the Spooled File to OnDemand.

The scripts defined within CoolSpools can be associated with a monitored Output Queue for fully automated processing. This is ideal for processing any new Spooled File reports that are created starting from the point of implementation.

The scripts can also can be run using command RUNSPLFCMD OPTION(*SCRIPT) for batch processing of existing spooled files on demand. The command parameters allow you to select which Spooled Files to process based on selection criteria including the Spooled File name, user data, output queue, user profile and age. This option is ideal for archiving a large backlog of historic Spooled File reports at the point of implementation.

CoolSpools even allows you to split a single Spooled File into multiple Spooled Files based on the content, so if a Spooled File report covers multiple sales regions, warehouses or business areas that need to be archived and indexed separately, CoolSpools will allow you to split the report before processing by IBM Content Manager OnDemand, thereby archiving and indexing each section of the Spooled File separately.

Once archived, IBM Content Manager OnDemand provides options to search for Spooled Files, and to recover them to an IBM i Output Queue as needed.

Archive Spooled Files as Excel or PDF

IBM Content Manager OnDemand supports loading of Excel and PDF documents via FTP. When documents are loaded using this method, the file name should be populated with indexing information. For example: MVS.JOBNAME.DATASET.FORM.YYDDD.HHMMSST.PDF

When using the CoolSpools Spool Converter module to convert a Spooled File to Excel, PDF or XML, the command parameters allow control over the converted document’s file name, which can be populated using special variables such as the date and time, or text from within the Spooled File content. The CoolSpools commands also support delivery of the converted document via FTP, so the converted PDF or Excel files can be delivered to IBM Content Manager OnDemand with indexing information embedded within the filename. CoolSpools also supports splitting of a single Spooled File report into multiple PDF or Excel documents, based on the content of the Spooled File. This means that a single Spooled File that includes all sales regions, warehouses or business areas can be split into separate documents for individual archiving and indexing.

Example CoolSpools Script

Here is a CoolSpools Spool Admin script that performs the following steps:

  1. Convert Spooled File to PDF and deliver the PDF document to IBM Content Manager OnDemand via FTP
  2. Deliver the underlying Spooled File to IBM Content Manager OnDemand with ADDRPTOND
  3. Move the Spooled File to an Output Queue named ARCHIVED to mark it as having been processed
Work with Splf Script Entries               COOLScript name . : ARCHIVE
Description . : Archive to IBM Content Manager OnDemand
Position to      Type options, press Enter.
   2=Change      3=Copy      4=Remove      5=Display Opt    Seq    Script entry
        10    OPTION(10) OPTPARM(FROMFILE(&F) TOSTMF(*FTP) JOB(&N/&U/&J) SPLNBR
        20    OPTION(99) OPTPARM(APPGRP(APPGRP) SPLF(&F) JOB(&N/&U/&J) SPLNBR(&
        30    OPTION(2) OPTPARM(FILE(&f) JOB(&n/&u/&j) SPLNBR(&s) OUTQ(ARCHIVEDBottom
F3=Exit    F5=Refresh    F6=Add    F11=Display text    F12=Cancel

 

Display Spooled File Script EntryScript name . . . . . . :  ARCHIVE
Sequence number . . . . :  0010
Text ‘description’  . . :  Convert to PDFOption  . . . . . . . . :  10
Option text . . . . . . :  Convert spooled file to PDF
Option parameters . . . :  FROMFILE(&F) TOSTMF(*FTP) JOB(&N/&U/&J) SPLNBR(&S) S
TMFOPT(*REPLACE) FTP(ONDEMANDSERVER ‘MVS.<:JOB:>.<:WAREHOUSE:>.STATEMENT.<:CURDA
TE:>.<:CURTIME:>.PDF’) EXITPGM(*VAR) EXITPGMPRM(*POS) EXITPGMPOS((*FIRST 1 2 10
JOB) (*FIRST 5 26 5 WAREHOUSE))
More…  F3=Exit   F12=Cancel

 

Display Spooled File Script EntryScript name . . . . . . :  ARCHIVE
Sequence number . . . . :  0020
Text ‘description’  . . :  Archive Spooled File with ADDRPTONDOption  . . . . . . . . :  99
Option text . . . . . . :  Archive to IBM Content Manager OnDemand
Option parameters . . . :  APPGRP(APPGRP) SPLF(&F) JOB(&N/&U/&J) SPLNBR(&S) JOB
SYSNAME(JOBNAME) SBMJOB(*NO)
More…  F3=Exit   F12=Cancel

 

Display Spooled File Script EntryScript name . . . . . . :  ARCHIVE
Sequence number . . . . :  0030
Text ‘description’  . . :  Move to ARCHIVED Output QueueOption  . . . . . . . . :  02
Option text . . . . . . :  Change Spooled File
Option parameters . . . :  FILE(&f) JOB(&n/&u/&j) SPLNBR(&s) OUTQ(ARCHIVED)More…F3=Exit   F12=Cancel

Note that the screenprints provided above are for illustrative purposes only; the exact parameter settings required will vary from site to site.

Adding OnDemand to CoolSpools Standard Options

You may note use of standard option 99 within the example above to run IBM Content Manager OnDemand command ADDRPTOND from within a CoolSpools script. This standard option is not included with the CoolSpools product as delivered, but can be easily added by running the command WRKSTDOPT and changing the definition of option 99 as shown below (adjust the ADDRPTOND parameter settings to match your site’s requirements).

Change Standard OptionOption  . . . . . . . . .  99
Text ‘description’  . . .  Archive to IBM Content Manager OnDemand           
Heading text  . . . . . .  99=Archive      Confirmation required . .  *NO 
*PUBLIC use authority . .  *YES            *PUBLIC change auth . . .  *NO 
Command string  . . . . .  ADDRPTOND APPGRP(APPGRP) SPLF(&F) JOB(&N/&U/&J) SPLN
BR(&S)                                                                          
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
            F3=Exit  F4=Prompt  F11=Prompted cmd  F12=Cancel  F14=Default

Once standard option 99 is defined, not only is it is available for use in CoolSpools scripts and automation, but also in the end user tool WRKSPLFPDM – an extended version of WRKSPLF included with CoolSpools that provides end users with access to additional processing options, such as CoolSpools conversion and distribution commands.