Aug 05, 2008
Make Your Data Flow Like A River – Part 1
By Paul Kiel and Dave Webber, Senior Output Consultants
Welcome again to AFP Tech, where we deal with the technical and implementation aspects of AFP and the computer output environment. In our last article we presented the AFP Driver for Windows, a free tool from InfoPrint Solutions Company. In this series of articles we will present something that could provide a low cost, high return solution that could save your company a large pile of cash, potentially several hundred thousand dollars.
Many companies have a need to create customer documents with sections that vary in size based on the amount of customer data contained therein. Bank statements are probably the most common example but certainly not the only one. Coding an application to create this output can be difficult, so difficult that a mini-industry of software providers has sprung up providing packages for dynamic formatting of AFP output. These packages are very powerful and have their place within this industry. But there is an alternative that may work for your company, an alternative that you may already have installed – all you need is to learn how to use it!
In this series of articles we will present one of the most powerful and yet probably least used functions of a page definition. Imagine for a moment a page definition that gives you the ability to flow text like word processor; create boxes that vary in size based on the contents; and create tables that can expand to any size to fit the number of rows they contain – even spanning pages. Now imagine that this same page definition is relatively easy to understand and create. Sound too good to be true? Friends, let us introduce you to the Record Formatting Function of the page definition (not a real snappy name but a nifty piece of code anyway).
An unfortunate fact is the reason many AFP types don’t know the first thing about the Record Formatting Function is because they think it is another name for a different function of the pagedef, field processing. If you think Record Formatting and field processing are the same then go get yourself a pot of coffee and a plate of cigarettes while we put that myth to rest, and along the way we’ll open your eyes to some really incredible functionality that you probably already have installed.
Do you have the ability to do Record Formatting already?
There are few things that are more fun than getting a new toy (be it a fishing rod or a Ferrari) and trying out all the features. As we mentioned, your installation might already support Record Formatting since it’s been around a while and if so, you can play around with the functions after you read this article. Here are the software levels that support Record Formatting:
· Print Drivers
o PSF/MVS 3.2.0 and later versions
o IPM AIX: 3.2 and later version
o IPM WIN: 2.1 and later versions
o PSF/400: i5/OS 5.01 and later versions (you’ll need to import the pagedefs from a different platform. Your application will need to output *LINE datatype with the record format name (explained later in this article) in the first 10 characters of each record)
· PPFA platforms
o PPFA/370: Supported via APAR PQ37413
o PPFA for Windows (if it shipped with IPM WIN 2.1 or later)
o PPFA for AIX (if it shipped with IBM AIX 3.2 or later)
Introduction to the Record Formatting Function
With a traditional page definition you mapped your line data into some new format, usually without the need for any application changes. This works well for data with a fixed format, data processing reports for example, but even with simple reports of columnar data the application typically had to do routine bookkeeping for things like generating column headings on each page, page numbering, etc… If your desired output required mid-page changes in formatting, for example, a bank statement where the number of transactions varied in each section, then creating a pagedef for line data can become significantly more complex. You could write native AFP or mixed-mode data, but you’re still dealing with a fair amount of complexity. Now, with the Record Formatting Function, you can create a pagedef that will do your routine bookkeeping stuff for you and at the same time allow you to handle formatting changes for variable sized sections easily. Some of the other things this pagedef can do are:
· Handle page headers and footers or trailers
· Create section headers that automatically reprint should the data in the section span a page boundary
· Insert page ejects automatically at the bottom margin
· Create graphic objects like circles, lines & graphs, both in black and white and color
· Automatic page numbering
As you can see, Record Formatting has some intriguing features. Hopefully, it doesn’t take much for you to imagine where you could make use of them right now. Also, hopefully, you’ll tune in for Part 2 of this series where you’ll learn even more about Record Formatting.
Watch for Part 2 of “Make Your Data Flow Like A River” in an upcoming issue of the OutputLinks eNews. In our next article we’ll get more into the nuts and bolts of things as we present the mechanics behind the Record Formatting Function.