Export endorse info on first and last piece of container

Exporting expressions and information including exporting data in presort order or import order, and importing information, along with error messages that may apply to this category.

Moderators: Chrissy, Steve, Terry, Donna, Dave, Eric, MartyH, Kristen, Geoff, Vince

Post Reply
User avatar
Eric
Moderator
Posts: 1909
Joined: Tue Sep 19, 2006 3:29 pm
Contact:

Export endorse info on first and last piece of container

Post by Eric » Thu Aug 13, 2009 4:00 pm

If you would like to only print the optional endorsement line on the first and last piece in a tray or sack use the command below.

1. Presort the list as normal
2. Click LABELS from the Print Presort window.
3. In the print settings window select DISK FILE from the output drop-down option in the upper left corner of the screen.
4. Export ALL fields to an AccuZIP6 5x database.
5. Get back to the regular database and pull down File>Open Database, Open the newly created database.
6. Open the command window from the Edit>Commands option and paste one of the two commands at the bottom of this post into the command statement syntax area.
7. Click Run.
8. The Traymark_ indicator will now be in the first and last piece of the container.
9. Pull down File>Export
10. Select the fields you want to export.
11. After selecting the Endorse field, put this expression into the Expression text box

IIF(!EMPTY(traymark_),PADL(ALLT(Endorse),30,"*"),SPACE(30))

If you want to export the container number and bundle number on the same line as the endorsement info, use this expression:

IIF(!EMPTY(traymark_),ALLT(PADL(TRANSFORM(VAL(cont_id)),3," "))+"*"+ALLT(PADL(TRANSFORM(VAL(gpb_id)),3," "))+PADL(ALLT(Endorse),30,"*"),SPACE(40))

12. Choose your export format, then click Export. Give the file a name, decide where you want to save it, then click Save.


Use the code below for presorts sorted in FORWARD ORDER

Code: Select all

SET SAFETY OFF
PUBLIC com_alias
com_alias=alias()
copy to "C:\merge.dbf" for !EMPTY(traymark_) or !Empty(pkgmark_) fields sequence,traymark_,pkgmark_
USE ("C:\merge.dbf") IN 0 ALIAS "merge"
SELECT("merge")
REPLACE all sequence with PADL(TRANSFORM(VAL(sequence)-1),7,"0")

INDEX ON ALLT(UPPER(sequence)) TAG mytag
SELECT(com_alias)
REPLACE all sequence with PADL(TRANSFORM(VAL(sequence)),7,"0")
*replace all traymark_ with "" pkgmark_ with ""
REPLACE traymark_ with merge.traymark_ for SEEK(ALLT(UPPER(sequence)),"merge")
USE IN IIF(USED("merge"),SELECT("merge"),0)
SELECT(com_alias)
replace traymark_ with "**" for recno()=reccount()


Use the code below for presorts sorted in REVERSE ORDER

Code: Select all

SET SAFETY OFF
PUBLIC com_alias
com_alias=alias()
copy to "C:\merge.dbf" for !EMPTY(traymark_) or !Empty(pkgmark_) fields sequence,traymark_,pkgmark_
USE ("C:\merge.dbf") IN 0 ALIAS "merge"
SELECT("merge")
REPLACE all sequence with PADL(TRANSFORM(VAL(sequence)+1),7,"0")

INDEX ON ALLT(UPPER(sequence)) TAG mytag
SELECT(com_alias)
REPLACE all sequence with PADL(TRANSFORM(VAL(sequence)),7,"0")
*replace all traymark_ with "" pkgmark_ with ""
REPLACE traymark_ with merge.traymark_ for SEEK(ALLT(UPPER(sequence)),"merge")
USE IN IIF(USED("merge"),SELECT("merge"),0)
SELECT(com_alias)
replace traymark_ with "**" for recno()=1


If you want to export the endorsement line on the first piece of each bundle, read this topic.

Post Reply