Top Navigational Bar

Blank Fields In A Merge
DocumentID: 662458
Revision Date: 29-Feb-96 8:49:31 PM

The information in this document applies to:
WordPerfect® 5.1 for DOS

Problem

Solutions: Problem
You are creating a merge. Some of the records in your secondary file may have at least one blank field. Depending on your primary file, this blank field may be on the same line as another field or on its own line. If a field is blank, you do not want an extra space or line to appear in the merged document.

Concept
The {IF NOT BLANK} and {END IF} merge commands are used to check specified fields in your merge to see if they are blank fields. If an indicated field is not blank, the commands following the {IF NOT BLANK} merge command are executed

The {IF NOT BLANK} and the {END IF} commands are found in Merge Codes (Shift+F9), under More (6).

Solution
Because there are two different types of problems in this document, we will present two different solutions.

Method 1
In the following example, the secondary merge file records have a First Name field, a Middle Initial field, and a Last Name field on the same line. Use the {IF NOT BLANK} command to see if the Middle Initial field is blank. If it is not blank, each customer's full name will be printed, including the middle initial. If it is blank, the first and last names will be printed without extra spaces between them.

            {FIELD}First~{IF NOT BLANK}MI~ {FIELD}MI~{END IF} {FIELD}Last~
            {FIELD}Address~

Method 2
In this example, not every record in your mailing list has a company name, so some of the Company fields will be blank. Rather than have a blank line between the Name field and the Address field, use the {IF NOT BLANK} command to check for the blank field.

            {FIELD}Name~{IF NOT BLANK}Company~
            {FIELD}Company~{END IF}
            {FIELD}Address~

See Also
*      Appendix K: Macros and Merge, Programming Commands in the WordPerfect 5.1 for DOS Reference manual
*       Appendix L: Merge Programming Commands in the WordPerfect 5.2 for Windows Reference Manual

Answer:

Details:


Product specifications, packaging, technical support and information (*Specifications*) refer to theUnited States retail English version only. Specifications for other versions may vary. All Specifications, claims, features, representations, and/or comparisons provided are correct to the best of our knowledge of the date of publication, but are subject to change without notice.OUR MAXIMUM AGGREGATE LIABILITY TO YOU AND THAT OF OUR DEALERS AND SUPPLIERS IS LIMITED. IT SHALL NOTEXCEED THE AMOUNT YOU PAID TO ACCESS THE INFORMATION. SEE LEGAL DISCLAIMER.