2 replies Latest Post - ‏2012-11-14T14:44:01Z by scott_klement
102 Posts

Pinned topic Convert spoolfiles?

‏2012-11-14T10:44:27Z |

I´m working in a company that have a large application developed in house. It´s almost 20 years old so most of the reports created are presented as spoolfiles.
The cost to convert all programs to send these reports to a databasefile instead is more than we think it´s worth.
I wonder if there are any program or feature that I have missed that can convert spoolfile (SCS and maybe IPDS) to DB2?
We are running our application in v7r1.

We have a software in a PC today that recieve spoolfiles and convert them to CSV or Excel but that program is also very old and isn´t supported in Windows 2008.
If there isn´t any solution in my OS/400, does anyone know a third party software that are up to date?
Updated on 2012-11-14T14:44:01Z at 2012-11-14T14:44:01Z by scott_klement
  • Arthur Adams
    Arthur Adams
    10 Posts

    Re: Convert spoolfiles?

    ‏2012-11-14T11:27:38Z  in response to SystemAdmin
    Because printer files have record formats, you could make use of various APIs (QUSLRCD, QUSLFLD etc) and write a generic program that would extract the data from the spool file records and write it to a data file. However, you would need to somehow identify which record format was used to create a particular spool file record before you could successfully extract the data from it.

    We use a software package at my company that does the same thing and can also export the data for conversion to various output formats including Excel. The package is called RouteOne and is sold by Uti400, who wrote and maintain the software. You can find out more at
    • scott_klement
      31 Posts

      Re: Convert spoolfiles?

      ‏2012-11-14T14:44:01Z  in response to Arthur Adams
      Although some programs write printouts using DDS-described record formats, not all do. For example, it's commonplace to use RPG O-specs to create reports, in this case, there's no record format, just whole records are written to the spooled file.

      Even if a record format was used, the DDS keywords are able to change the data around. For example, a DDS keyword could be used to print the data from one record across many lines of text on the spooled file. Or it could be used to insert additional text or graphics.

      So, really, once the data is in the spool, there's no good way to relate it back to the original record format. The record format might be useful for intercepting the data when it's output from a program -- but isn't useful for interpreting a spooled file.

      Instead, I would consider some software that does "pattern detection". Figures out the layout of the rows by scanning the data, looking for where columns start/end, and then extracts the data.

      Personally, though, I'd suggest changing the existing programs so they write in the format you desire. If you want it in DB2 format, just change the program to write it in DB2 format. GRanted, if there are a lot of programs, this may take some time, but it's a million times more accurate and versatile.