In order for the imbarcode and imbigits fields to populate, this requires information to appear in the field named barcode. The barcode field gets populated during the validation event. Therefore, in order to print the intelligent mail barcode, you must validate your list prior to presorting.
If validation leaves some records with nothing in the field named Barcode, then those records will not get the IMBarcode or IMBDigits fields populated.
After validation, you can pull down the Edit menu to Command, create a new command, and run the command below:
Code: Select all
Replace barcode with "/"+LEFT(zip,5)+SUBSTR(PADL(ALLT(STR(100-(VAL(SUBSTR(zip,1,1))+VAL(SUBSTR(zip,2,1))+VAL(SUBSTR(zip,3,1))+VAL(SUBSTR(zip,4,1))+VAL(SUBSTR(zip,5,1))))),2,"0"),2,1)+"/" FOR EMPTY(barcode) AND ISDIGIT(LEFT(zip,1))
After running the command, you're ready to presort your list and proceed as usual.