Page 1 of 1

Add a package break mark to non-packaged based presort file

Posted: Thu Feb 05, 2015 12:28 pm
by Dave
If you need a "*" in the pkgmark_ field on package breaks, then use the following code to add this.

Presort your list as normal.
Click the Print Labels option in the Print Presort screen.
Select Disk File for the Output format.
Select ALL fields, and export to an AccuZIP6 5x database.
Open the Edit|Command window and paste the following:

Code: Select all

ON ERROR com_message=message()
comAlias=ALIAS()
SET SAFETY OFF

SELECT GPB_ID,cont_id FROM (comAlias) GROUP BY 1,2 INTO TABLE "C:\unique.dbf" readwrite
	USE
	USE ("C:\unique.dbf") IN 0 ALIAS "unique"
SELECT(comAlias)
	INDEX ON allt(cont_id)+allt(GPB_ID) tag mytag
SELECT ("unique")
	alter table alias() add column sequence c(7)
	replace sequence with &comAlias..sequence for SEEK(allt(cont_id)+allt(GPB_ID),comAlias)
SELECT ("unique")
	INDEX ON allt(sequence)+allt(GPB_ID) tag mytag
SELECT(comAlias)
	replace Pkgmark_ with "*" for SEEK(allt(sequence)+allt(GPB_ID)  ,"unique")
USE IN IIF(USED("unique"),SELECT("unique"),0)
This will add the * in the Pkgmark_ field for package breaks on non-packaged based mailings.