iCan Blog Archive

I have heard clients wish that IBM provided an option when working with spooled files to create a PDF of that spooled file.  Don’t expect IBM to provide this enhancement – a way already exists for you to extend the interface and do this yourself.

It can be accomplished by using the UIM Spooled File User-defined List Action Exit Program. This exit program allows you to define additional actions on the following green screen interfaces:

  • Work with Printer Output (WRKSPLF ASTLVL(*BASIC))
  • Work with Spooled Files (WRKSPLF ASTLVL(*INTERMED))
  • Work with Job Spooled Files (WRKJOB OPTION(*SPLF))
  • Work with Output Queue (WRKOUTQ output queue name)
  • Work with Spooled File Status (D P or WRKSPLF DSPFMT(*S36FMT))

You can define additional actions for each command. For example, you could add an option “C” that invokes the CPYSPLF command to convert the spooled file to a PDF.  You may recall that IBM put out a PTF in 7.1 to enhance CPYSPLF as I wrote about in Copy Spooled Files to PDFs.  This support is in the base release for 7.2 and later releases.

IBM has made it easy for you to get started by providing a sample tool in QUSRTOOL. A description of this example can be found in the TSPUIMLI member in the QATTINFO file in the QUSRTOOL library. The instructions to set up the example are very simple.  Once you have the setup done, you can use a “C” on the option input to initiate a CPYSPLF command for the selected spooled file. You won’t see the “C” on the display, but it does work. In the example, you are given the CPYSPLF command prompt with the spooled file name filled in for you, but you need to specify the other parameters. You could extend the example to specify the additional parameters that are needed to generate the PDF. You will want to take a look at the TSPUIML CL program if you want to extend it.

The IBM support article, Adding Options to WRKSPLF, WRKOUTQ and WRKJOB to Invoke the CPYSPLF and SNDTCPSPLF Commands, is a handy resource for more information on how to accomplish this.

Finally, if you are a user of the Navigator Web console, this function is already on the GUI, as the screen capture below shows.

This blog post was edited to fix broken links on April 15, 2020.

This blog post was originally published on IBMSystemsMag.com and is reproduced here by permission of IBM Systems Media.