New Dog, Old Tricks
Merging documents using PC word processing products
From "Migration", Access to Wang, February 1996
|[ Prior Article ] [ Return to the Catalog of articles ] [ Next Article ]|
Continuing our coverage of replacing the functionality of Wang Word Processing with other products, this month we'll cover document merge capabilities.
As the first minicomputer system to combine data processing and document capabilities, the Wang VS attracted many applications that merged the two technologies. Many of these applications are still in use because the integration was so powerful. As PC word processing programs grew in popularity and gained publication- quality output, Wang WP may no longer be enough.
As before, my examples will be drawn from specific products (Microsoft Word for Windows, for one) but should be applicable to other PC and Macintosh products. I will also presume you have a way to transfer files from your VS to your desktop systems - should the VS be the location of your primary data.
Before looking at specific methods let's review the components and requirements for a typical merge application. Picture a V- shaped diagram, where a main document (known as a primary document in Wang WP manual) is melded with a table of information (known as a secondary document to Wang users) to produce a combined output. The output may be a new document (the approach Wang WP uses) or a print file. A typical example is a standard form letter that is sent to a varying list of recipients, where the recipient's name, address, and other information is merged into the stock letter format.
The main document is similar to a regular document, with all of the formatting and other characteristics required for a pleasing output. The locations of data fields to be merged are held with special characters (the MERGE symbol in Wang WP).
Secondary documents resemble data files, with rows and columns of data . These rows and columns correspond to records and fields in conventional data processing, but unlike most VS data files the fields are variable in length and separated with delimiters. Wang WP secondary documents require MERGE symbols between fields and a DON'T MERGE symbol at the end of each line.
When the Wang WP merge is performed, fields are taken from the columns in the secondary document and matched (in their order of appearance) with merge placeholders in the primary document to produce the final result. This process is performed using the Document Merge option of the COPYWP utility. Screens accept the document IDs of the primary and secondary documents and the ID of the document to be created by the merge (or "next" for the next document ID in a library). If the result is larger than the largest allowable size for a WP document (120 pages), COPYWP will create multiple documents.
Document merging with PC word processing products is similar to the WP process described above. Like WP, PC products use a main document, merge symbols, and delimited data file for input. Still, there are some significant differences:
In most PC word processing programs, the fields (columns) are identified by name - usually contained in the first row of data in the file. Wang WP merges fields in the order they appear on the line.
Fields that are not needed can be skipped in PC word processing merges; the primary document can contain only those fields that you need.
The results of the merge process can be previewed, either by checking the validity of the data file (e.g. the Edit function of Word's mail merge helper) or by displaying the results using Print Preview.
Some programs allow you to modify the contents and presentation of the data file. For example, Word for Windows has sophisticated Query functions and options to sort the columns before the merge.
Special font attributes can control the appearance of the merged data. For example, data with mixed case (upper and lower case) can be specified to show in capital letters only.
Word processing users that work on a network may be able to distribute the finished merge document via electronic mail with the built-in mail options in PC products.
In short, those familiar with the process of creating Wang WP merge documents should find the transition to other word processing products easy. The hard part - now as before - lies in creating the variable information to be merged.
Secondary documents (data) can be created manually by entering information and the appropriate delimiters, but this is a time- consuming and error-prone process. Larger, more frequent application needs dictate an automated approach. There are several ways Wang users have approached this need:
WP "data bases": In this model, the data is entered directly into a WP document and maintained within that document. Since the original data is usually found in other systems (data processing applications, etc.), this requires initial re-keying and manual comparisons to keep it in synch with other information. WP Glossaries may be used to automate some or all of this process.
Extract programs: A program is created to extract data from a primary business system and create a text file. This file is converted to a WP document - possibly using the conversion capabilities of COPYWP - and used for merge purposes. This method requires customized programs and procedures tailored to the needs of the business. (For a discussion of how to create special characters in a text file and convert it to WP, see Wang's VS Media, Transfer, and Device Utilities Reference (publication number 715-1716) and look for the section on Image files in the COPYWP documentation.)
List Processing software: The most automated method of merge document creation, but few Wang users still use this product. In expert hands, some macro languages used by word processing products can approach the sophistication of List Processing, but PC products lack some abilities to be launched in a batch (non- interactive) mode and, therefore, are difficult to fully automate.
Whatever the method used to create the secondary document, the field sizes must vary according to the actual length of the data so that trailing spaces are not inserted into the merged output where they are not desired. Fixed-length data files (see Figure 1) - the type most prevalent in data processing environments - will have this additional space at the end of each field. The desired output is shown in Figure 2, which also illustrates the use of field names in the first record of the file.
Of course, if the source of your primary business information is a LAN-based data base or a spreadsheet, the conversion process is much different. Most PC data base and spreadsheet products allow conversion to text format with tabs separating, and some will even link directly to your word processing software, eliminating the need to convert. Watch out for some conversions, though; recent products have including unwanted formatting information (font, size, weight, etc.) along with the text, overriding the characteristics in the primary document.
Much of the time the tools used for merge applications are a given, as when the organization has standardized on a particular word processing program and wants all work to be within that format. If you are new to the market for PC tools and have simple needs, I suggest you consider one of the several integrated ("works") products , which combine spreadsheet, word processing, and data base functions into a single, integrated environment. Such products are easier to use and inexpensive; many are shipped with computer systems for no additional charge. While not as rich in features as their more expensive siblings, integrated products offer good functionality and easier integration.
Interest in further Wang online information has continued to grow - probably due to the demise of nearly all user support organizations. The Wang user group in the United Kingdom continues to operate; you can view samples of their excellent newsletter through the Thomas Junker's Unofficial Wang VS Information Center, a World Wide Web page located at address http://www.phoenix.net/~tjunker/wang.html. And contact me through the magazine if you have any comments or questions on integration or migration.
Figure 1: Fixed-field data file
Record 1 2 3 5 6 Number 12345678901234567890123456789012345678901234567890 1 Flintstone Fred Bedrock < 2 Rubble Barney Gravelstone < 3 Barnes Dennis Seattle <
< Record delimiter (RETURN character or DON'T MERGE symbol)
Figure 2: Variable-field data file
Record 1 2 3 5 6 Number 12345678901234567890123456789012345678901234567890 1 first_name^last_name^city< 2 Flintstone^Fred^Bedrock< 3 Rubble^Barney^Gravelstone< 4 Barnes^Dennis^Seattle<
^ Field delimiter (tab character or MERGE symbol)
< Record delimiter (RETURN character or DON'T MERGE symbol)
Copyright © 1996 Dennis S. Barnes
Reprints of this article are permitted without notification if the source of the information is clearly identified