Top Navigational Bar

A Primary Merge File That Deletes Duplicate R
DocumentID: 635020
Revision Date: 29-Feb-96 3:03:43 PM

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

Problem

Solutions: The following primary merge file will examine a secondary file and delete any records with duplicate information in Field 1. The line numbers to the left are for convenience only--do not type them in.

1      {ON ERROR}{GO}end~~{COMMENT}
2      ~{ASSIGN}total~~{ASSIGN}transfer~~{COMMENT}
3      ~{LABEL}top~{ASSIGN}total~{VARIABLE}total~+1~{COMMENT}
4      ~{COMMENT}
5      ~{IF}{LEN}{FIELD}1~~>15~{COMMENT}
6       ~{LOCAL}1~{MID}{FIELD}1~~0~15~~{COMMENT}
7      ~{ELSE}{COMMENT}
8       ~{LOCAL}1~{FIELD}1~~{COMMENT}
9      ~{END IF}{IF EXISTS}{VARIABLE}1~~{COMMENT}
10       ~{NEXT RECORD}{COMMENT}
11      ~{ELSE}{LOCAL}{VARIABLE}1~~x~{COMMENT}
12      ~{FIELD}1~{MRG CMND}{END FIELD}
13      {MRG CMND}{FIELD}2~{MRG CMND}{END FIELD}
14      {MRG CMND}{FIELD}3~{MRG CMND}{END FIELD}
15      {MRG CMND}{MRG CMND}{END RECORD}
16      ===============================================[HPg]
17      {MRG CMND}{ASSIGN}transfer~{VARIABLE}transfer~+1~{COMMENT}
18      ~{NEXT RECORD}{END IF}{GO}top~
19      {LABEL}end~{COMMENT}
20      ~ {ASSIGN}deleted~{VARIABLE}total~
21      {VARIABLE}transfer~~{COMMENT}
22      ~{CHAR}0~Transferred {VARIABLE}transfer~ of {VARIABLE}total~ records--{VARIABLE}deleted~ 23 duplicates deleted. (Press any key)~

If you wish to test for duplicates on a field other than {FIELD}1~, change the 1 to the name or number of the field you want on lines 5, 6, and 8. If you have more or less than three fields in your secondary file records, modify lines 12-15 accordingly.

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.