dlv@CUNYVMS1.GC.CUNY.EDU (Dimitri Vulis) (02/28/91)
Unfortunately, it seems that my article will _not_ be appearing in TUGBoat. So, I'm posting the (improved) macros and an example file here, and later I will post the entire article and an explanation of why it's not in TB and what I think about TB (nothing good :). I'll post now parts of the paper that are highly relevant (being parts, they lack coherence :). ------- Parts of documentation: It is reported that recently the United States Postal Service board of governors approved the 27-cent ``public automation rate'' for first-class mail whose envelopes are pre-printed with a ZIP+4 code and a Postnet bar code, versus the new 29-cent rate for first-class mail. The vendors of commercial bar code printing programs claim that putting a Postnet code and a facing identification mark on an envelope speeds up delivery, but the post office denies this. My limited tests seem to indicate that there is no speed-up for mail sent locally in New York City, but non-local mail is sometimes delivered a day faster if it has pre-applied bar codes. The post office does say that using postage meter imprints, which don't need to be faced and canceled, instead of adhesive stamps, speeds up mail processing, and saves time for the user. By 1993 the Post Office plans to implement an 11-digit system, where the additional two digits will be used to sequence the mail in route delivery order. \TeX\ macros presented here should be compatible with this change. \TeX\ is very good at making bar codes. Some years ago I used \MF\ to make 3 of 9 bar codes, and Peter Flynn pointed out that \TeX\ is very good with rules and can be used to make bar codes by itself; so I wrote these macros. Unfortunately, mail with FIMs, ZIP+4 codes, and bar codes looks like junk mail, and recipients may throw it away without opening. One shoud always give one's ZIP+4 code as part of one's snailing address. Users of these macros are also likely to be faced with the problem of adding the 4-digit suffix to existing address files. The Post Office says it will add ZIP+4 codes to a printout of an address list for free. I have not tested this service, but it says one can print out the contents of one's snailing address file, send it to the post office, and get it back with the ZIP+4 codes added, which one can then add to one's file. The Post Office also says it would accept a mailing list (between 350 and 50,000 entries) on a floppy disk (in ASCII format with fixed length fields), and update it with ZIP+4 codes for free. (Ask for form 5603, ``Request for ZIP+4 coding of address files on diskettes''.) There is a public-access terminal in New York Central Post Office which allows one to key in one's addresses and obtain the corresponding ZIP+4 codes. I've used to it update much of my address book to ZIP+4 codes. However, I found that for many people I correspond with the only kind of snailing address I have is of the form {\addressfont\noindent Prof.~Chaim R.~Shafarevich\\ Department of Algebraic Masonry\\ Emanuelle University\\ Smalltown, NY 10101 } The public access terminal calls such an address insufficient (indeed, it lacks the street address!), and refuses to give the ZIP+4 code. Experience shows that mail addressed in this manner still gets delivered. The 10101 post office in Smalltown knows where Emanuelle University is. Presumably, the same software is used by the Post Office for its free service, so such addresses won't be automatically ZIP+4-coded. In such cases, I found that both the street address and the ZIP+4 code are often found on preprinted departmental stationery, whose return address was presumably composed by Emanuelle University's mailroom in cooperation with the 10101 post office. Occasionally, distinct departments have distinct ZIP+4 extensions. The stationery also sometimes includes an internal mail stop; putting that on the envelope may make internal delivery faster after the post office delivers the letter to Emanuelle University's mailroom. Another source of ZIP+4 codes are pre-printed envelopes. For example, the American Math Society lists only the 5-digit code 02940, but its preprinted envelopes have the 9-digit code \ZipBar{02940-9943}\box\PostNetBox, which is, one can easily see, 02940-9943. (Of course, this could be found via the post office computer.) For mail going outside of the US, the country name in capital letters should be the only entry on the last line of the address. Endorsements for special services (restriced delivery, do not forward, registered mail, forwarding and address correction requested, etc) should be placed above and flush left with the delivery address. All these data can be given as an argument to the |\envaddress| macro. I hard-coded Commercial~\#10 size; other common envelope sizes are Monarch, 3.875in~$\times$~7.5in, and in Europe: DL, 110mm~$\times$~220mm and C5, 162mm~$\times$~229mm. It's possible to print several envelopes at once by repeatedly calling |\begin{envelope}| and |\end{envelope}|. There are absolutely no conventions about feeding envelopes into various printers and telling the device driver to print landscape. With Eberhard Mattes' excellent |dvihplj| driver and my unusual printer I seem to achieve reasonable results with the options |/tr3 /l-1in /t3.5in| (rotate 90 degrees clockwise, and change offsets). It's desirable to have the FIM facing the inside, since most printers can't print on the outside edge. One needs to discover the correct options and envelope feeding procedure for one's driver/printer combination by trial and error. The layout of database tables for mass mailing lists and for one's personal correspondence is similar: each row should contain a unique identifier for joining with other data tables, an optional salutation, and the complete address (preferrably, with ZIP+4 code and carrier route, and room for ZIP+6). But the operations are somewhat different for the two applications. For a mass mailing list, it's desirable to detect similar entries (i.e., slight variations of the same addressee) to avoid duplicate entries, and to be able to select a random sample of a specified size (the so called $n$th sample, used for tests); while for a personal address file it would be convenient to have a tool similar in spirit to \BibTeX, where the user would reference only a name tag, or a name and a department tag, in the \TeX\ file, and one or more clever programs would pull the missing address information from the address table and complete the letter and the envelope, just like \BibTeX\ retrieves references from tags in a \LaTeX\ file. I may eventually write such a program. Alas, the days when people wrote \TeX ware and freely distributed it with source code are gone; crooks peddle programs that other people wrote and use the name ``\TeX'' to refer to non-\TeX s, against Knuth's wishes, and instead of being ostracized by the \TeX\ users' community, they are permitted to advertize their wares in the TUGBoat, casting doubts on this newsletter's editorial integrity. This will yet lead to \TeX's demise. I try to deal with this problem by not talking to people that deal with such crooks. These macros have not been certified by the Post Office, and are not warrantied to do anything at all. You may use them at your own risk. The certification process costs \$375, and I'm not making any money by giving them away for free. The macros are copyrighted, though. ---------- Example file: % This is used to print one or more envelopes on the laser printer. %\begin{envelope} %Prof. Blah\\ %Department of Mathematics\\ %City, State Zip %\ZipBar{Zip-Zip} %\end{envelope} \documentstyle[env]{article} \nofiles \textwidth9.5in \textheight4.125in \pagestyle{empty} \begin{document} \from{Dimitri Vulis} \begin{envelope} \envaddress{ Dimitri Vulis\\ Department of Mathematics/Box 330\\ Graduate School \& University Center\\ City University of New York\\ 33 West 42 Street\\ New York, New York 10036 } \ZipBar{10036-8099} \end{envelope} \end{document} ---------- The file env.sty: % Copyright 1988, 1991 by Dimitri Vulis. % All rights reserved. \newbox\PostNetBox \newbox\ZipBarL \newbox\ZipBarS \setbox\ZipBarL\hbox{\vrule \@height.125in \@width.020in\hskip.0276in} \setbox\ZipBarS\hbox{\vrule \@height.05in \@width.020in\hskip.0276in} \newcount\ZipBarm \newcount\ZipBarn \chardef\ten=10 %Almost like using \ifcase, but `-' is skipped \def\ZipBar@@@#1#2{% \expandafter\def\csname ZipBar@@#1\endcsname% {#2\advance\ZipBarn#1\relax}} \ZipBar@@@0{\copy\ZipBarL\copy\ZipBarL% \copy\ZipBarS\copy\ZipBarS\copy\ZipBarS} \ZipBar@@@1{\copy\ZipBarS\copy\ZipBarS% \copy\ZipBarS\copy\ZipBarL\copy\ZipBarL} \ZipBar@@@2{\copy\ZipBarS\copy\ZipBarS% \copy\ZipBarL\copy\ZipBarS\copy\ZipBarL} \ZipBar@@@3{\copy\ZipBarS\copy\ZipBarS% \copy\ZipBarL\copy\ZipBarL\copy\ZipBarS} \ZipBar@@@4{\copy\ZipBarS\copy\ZipBarL% \copy\ZipBarS\copy\ZipBarS\copy\ZipBarL} \ZipBar@@@5{\copy\ZipBarS\copy\ZipBarL% \copy\ZipBarS\copy\ZipBarL\copy\ZipBarS} \ZipBar@@@6{\copy\ZipBarS\copy\ZipBarL% \copy\ZipBarL\copy\ZipBarS\copy\ZipBarS} \ZipBar@@@7{\copy\ZipBarL\copy\ZipBarS% \copy\ZipBarS\copy\ZipBarS\copy\ZipBarL} \ZipBar@@@8{\copy\ZipBarL\copy\ZipBarS% \copy\ZipBarS\copy\ZipBarL\copy\ZipBarS} \ZipBar@@@9{\copy\ZipBarL\copy\ZipBarS% \copy\ZipBarL\copy\ZipBarS\copy\ZipBarS} \def\ZipBar@@#1{\csname ZipBar@@#1\endcsname} \def\ZipBar@#1{% \ifx#1\null% \let\next\relax% \else% \ZipBar@@{#1}% \let\next\ZipBar@% \fi% \next} \def\ZipBar#1{ \ifx#1\empty\else% \ZipBar{} \setbox\PostNetBox\hbox{% \copy\ZipBarL% start with a frame bar \ZipBarn\z@% \ZipBar@#1\null% \ZipBarm\ZipBarn% \divide\ZipBarm\ten% \multiply\ZipBarm\ten% \advance\ZipBarm-\ZipBarn% \ifnum\ZipBarm<0% \advance\ZipBarm\ten% \fi% \ZipBar@@{\the\ZipBarm}% correction digit \copy\ZipBarL% end with a frame bar }% \fi% if empty } \newbox\FIMbox \setbox\FIMbox\vbox{% \hrule\@height.625in\@width.031in} \setbox\FIMbox\hbox{\copy\FIMbox \hskip.0315in\copy\FIMbox\hskip.1565in% \copy\FIMbox\hskip.1565in% \copy\FIMbox\hskip.0315in\copy\FIMbox} \newif\if@FIM \newbox\AddressBox \newbox\FromBox \setbox\FromBox\null \let\addressfont\twlsf \def\EnvMakeBox#1#2{ \setbox#1\vbox{ \parindent0pt \leftskip0pt \lineskip1pt \baselineskip12pt \rightskip\@flushglue \addressfont #2}} \def\envaddress#1{\EnvMakeBox\AddressBox{#1}} \def\from#1{\EnvMakeBox\FromBox{#1}} % defaults are FIM and no Postnet \def\envelope{ \@FIMtrue \setbox\PostNetBox\null \setbox\AddressBox\null } \def\endenvelope{ \newpage \if@FIM \vbox to 0pt{ \hbox to \hsize{\hfill \copy\FIMbox\hskip2in} \vss} \fi % These magic numbers are for our stationery \vbox{\vskip.435in\hbox{\hskip.32in\copy\FromBox}} \vfill \vbox to0pt{\vss % Address is 1 inch from the left % and 1 inch from the bottom \hbox{\hskip1in\box\AddressBox} \vskip.375in} \vbox to .625in{ \vfill \hbox to \hsize{ \hfill \hbox to 3.875in{ \unhbox\PostNetBox\hfill}} \vskip.25in }}
fritchie@sachiko.acc.stolaf.edu (Scott Fritchie) (03/01/91)
My posting has little to do with (La)TeX (other that me being a devoted fan and devout user), but there are a couple of items in Dimitri Vulis's recent posting that I would like to comment on. Hopefully it will be of interest to the net community in general. NOTE: 1. This posting is rather long. 2. I'm wearing my asbestos suit in the event of "Wrong newsgroup, silly!" flames. (Where would I post it? ...) In article <00944e15.cdff08a0.5442@CUNYVMS1.GC.CUNY.EDU> dlv@CUNYVMS1.GC.CUNY.EDU (Dimitri Vulis) writes: The vendors of commercial bar code printing programs claim that putting a Postnet code and a facing identification mark on an envelope speeds up delivery, but the post office denies this. My limited tests seem to indicate that there is no speed-up for mail sent locally in New York City, but non-local mail is sometimes delivered a day faster if it has pre-applied bar codes. It will speed up delivery, especially during busy times (Christmas) when hand-written mail makes up a greater percentage of the total mail flow. Each of the USPS's human operators can process one mail piece per second, give or take a couple of tenths. The barcode/optical character recognition machines process an the average of 11 pieces/second. The machines can also automatically sort by carrier route and ZIP+4. In fact, all incoming mail at medium to large facilities goes through the OCR machines first. If it's readable or has a Postnet barcode, it bypassees the human operators entirely. By 1993 the Post Office plans to implement an 11-digit system, where the additional two digits will be used to sequence the mail in route delivery order. A ZIP+4 can only be machine-sorted to an area about the size of one side of a city block or part of an apartment building (for example). The human carrier still needs to spend time before making rounds sorting his/her mail by hand to collect all the Jones' mail in one clump, get the clumps in the proper order, etc. The purpose of the 11 digit ZIP is to eliminate that human sorting. It's time intensive and error-prone. Eleven digits are enough to assign each household, apartment, company division, and whatever else its own unique number. The USPS, I think, is drooling over the opportunity to use such a feature. Unfortunately, to my knowledge no one has come up with a systematic way of assigning those numbers. The USPS has to deal with every state and municipality naming and addressing their streets in willy-nilly fashion, and that chaos is making the 11 digit ZIP process difficult. The Post Office says it will add ZIP+4 codes to a printout of an address list for free. I have not tested this service, but it says one can print out the contents of one's snailing address file, send it to the post office, and get it back with the ZIP+4 codes added, which one can then add to one's file. The Post office also says it would accept a mailing list (between 350 and 50,000 entries) on a floppy disk (in ASCII format with fixed length fields), and update it with ZIP+4 codes for free. (Ask for form 5603, ``Request for ZIP+4 coding of address files on diskettes''.) I'm part of the organization that provides this service. As far as I am aware of, this service is not provided free of charge. (Rah Rah Capitalism! Go Team! :-) I hope I am not in error, though I suppose I could be. ... The service is provided by the National Address Informaion Center. The process can do the following: 1. Address standardization, correcting the address for spelling errors, conversion to uppercase only, proper abbreviations, and proper street, city, and state spellings. The USPS is making this a big priority -- it makes the OCR's job much easier. 2. Carrier route matching. Very useful for bulk mailers as well as the USPS. 3. ZIP+4 matching. Useful for everyone. 4. Secondary matching information. This information can tell you if the address was matched, if it was the finest level of match possible, what type of record was matched (street, apartment, firm, rural route, highway contract route, postmaster, or general delivery), and what sorts of corrections were made, if any. If memory serves correctly, the folks sitting on latest USPS rate commission, aside from raising First Class and other rates, are making the criteria for qualifying for carrier route and ZIP+4 discount rates much, much tougher to qualify for. Organizations sending mail of almost any volume should look into using this service or purchasing software that will do it for them, lest their postage discounts be taken away from them! :-) {\addressfont\noindent Prof.~Chaim R.~Shafarevich\\ Department of Algebraic Masonry\\ Emanuelle University\\ Smalltown, NY 10101 } The public access terminal calls such an address insufficient (indeed, it lacks the street address!), and refuses to give the ZIP+4 code. Experience shows that mail addressed in this manner still gets delivered. The 10101 post office in Smalltown knows where Emanuelle University is. An address must have a "delivery address". Usually it's a street address of some sort (e.g. 101 MAIN ST). A college or university, if small enough, might have "BOBS SCHOOL OF QUANTUM MECHANICS" as its delivery address. However, if the above address were supposed to be: EMANUELLE UNIVERSITY 101 W SMALL WAY SMALLTOWN NY 10101-1001 the delivery address would be "101 W SMALL WAY". The secondary address, "EMANUELLE UNIVERSITY", would not be considered when trying to make a match (unless a 'firm' record type were found). Since the original address doesn't include the required delivery address, the match fails due to insufficient information. Yikes! This went on for much longer than I'd originally anticipated. Feel free to Email me any questions you might have on addressing standards, address parsing, standardization, and/or standardization software. -Scott --- Scott Fritchie, 4810 Underwood Ave., Omaha, NE 68132-2420 USA 402.553.4084 Government Services, American Express's Integrated Marketing Services Play: fritchie@acc.stolaf.edu ..!umn-cs!stolaf!fritchie Work: 402.498.2124 "'Cascade gets dishes virtually spotless.' What does it do? Swap them to hard disk? Swap them to hard water?"
fritchie@sachiko.acc.stolaf.edu (Scott Fritchie) (03/01/91)
Oops. Two things. 1. I apologize for the bad grammar in the first sentence and for any other pithy little errors I may have missed. 2. I forgot a disclaimer, which I will attach now. The material in my previous posting is my own personal ramblings and is in no way officially connected to the US Postal Service, American Express, Integrated Marketing Services, or First Data Resources. -Scott --- Scott Fritchie, 4810 Underwood Ave., Omaha, NE 68132-2420 USA 402.553.4084 Government Services, American Express's Integrated Marketing Services Play: fritchie@acc.stolaf.edu ..!umn-cs!stolaf!fritchie Work: 402.498.2124 "Yeah, boss, I'll be in late today. UNIX refuses to boot on my Ford."
fritchie@sachiko.acc.stolaf.edu (Scott Fritchie) (03/02/91)
Pardon me for yet another not-really-TeX-related posting here -- this is an error correction. The USPS does indeed offer ZIP+4/address standardization service for free. There is, however, a limit on the size of the database submitted. I couldn't confirm the limit, but a reasonably confident colleague said it is now 15,000 records. -Scott --- Scott Fritchie, 4810 Underwood Ave., Omaha, NE 68132-2420 USA 402.553.4084 Government Services, American Express's Integrated Marketing Services Play: fritchie@acc.stolaf.edu ..!umn-cs!stolaf!fritchie Work: 402.498.2124 "Yeah, boss, I'll be in late today. UNIX refuses to boot on my Ford."
dlv@cunyvms1.gc.cuny.edu (Dimitri Vulis, CUNY GC Math) (03/07/91)
Burton Randol pointed out to me the following glitch in the Postnet macros I posted a few days ago. The old code said: \ifx#1\empty\else% \ZipBar{} This was really a bug!!! :) I added this at the last moment because without checking for an empty argument \ZipBar{} produced frame bars and a single checksum digit (0). But of course I meant: \gdef\zipcode{#1}% \ifx\zipcode\empty\else% Shame on me!!! :) Anyway, I've fixed this and I made a couple of other cosmetic changes, so I'm re-posting the corrected macros. Please discard the old ones. Sorry!! Dimitri Vulis ---- env.sty % Copyright 1988, 1991 by Dimitri Vulis. % All rights reserved. \newbox\PostNetBox \newbox\ZipBarL \newbox\ZipBarS \setbox\ZipBarL\hbox{\vrule \@height.125in \@width.020in\hskip.0276in} \setbox\ZipBarS\hbox{\vrule \@height.05in \@width.020in\hskip.0276in} %counters used to compute the checksum \newcount\ZipBarm \newcount\ZipBarn \chardef\ten=10 \def\ZipBar@@@#1#2{% \expandafter\def\csname ZipBar@@#1\endcsname% {#2\advance\ZipBarn#1\relax}} \ZipBar@@@0{\copy\ZipBarL\copy\ZipBarL% \copy\ZipBarS\copy\ZipBarS\copy\ZipBarS} \ZipBar@@@1{\copy\ZipBarS\copy\ZipBarS% \copy\ZipBarS\copy\ZipBarL\copy\ZipBarL} \ZipBar@@@2{\copy\ZipBarS\copy\ZipBarS% \copy\ZipBarL\copy\ZipBarS\copy\ZipBarL} \ZipBar@@@3{\copy\ZipBarS\copy\ZipBarS% \copy\ZipBarL\copy\ZipBarL\copy\ZipBarS} \ZipBar@@@4{\copy\ZipBarS\copy\ZipBarL% \copy\ZipBarS\copy\ZipBarS\copy\ZipBarL} \ZipBar@@@5{\copy\ZipBarS\copy\ZipBarL% \copy\ZipBarS\copy\ZipBarL\copy\ZipBarS} \ZipBar@@@6{\copy\ZipBarS\copy\ZipBarL% \copy\ZipBarL\copy\ZipBarS\copy\ZipBarS} \ZipBar@@@7{\copy\ZipBarL\copy\ZipBarS% \copy\ZipBarS\copy\ZipBarS\copy\ZipBarL} \ZipBar@@@8{\copy\ZipBarL\copy\ZipBarS% \copy\ZipBarS\copy\ZipBarL\copy\ZipBarS} \ZipBar@@@9{\copy\ZipBarL\copy\ZipBarS% \copy\ZipBarL\copy\ZipBarS\copy\ZipBarS} \def\ZipBar@@#1{\csname ZipBar@@#1\endcsname} \def\ZipBar@#1{% \ifx#1\null% \let\next\relax% \else% \ZipBar@@{#1}% \let\next\ZipBar@% \fi% \next} \def\ZipBar#1{% \gdef\zipcode{#1}% \ifx\zipcode\empty\else% \@FIMAtrue% \setbox\PostNetBox\hbox{% \copy\ZipBarL% start with a frame bar \ZipBarn\z@% \ZipBar@#1\null% \ZipBarm\ZipBarn% \divide\ZipBarm\ten% \multiply\ZipBarm\ten% \advance\ZipBarm-\ZipBarn% \ifnum\ZipBarm<0% \advance\ZipBarm\ten% \fi% \ZipBar@@{\the\ZipBarm}% correction digit \copy\ZipBarL% end with a frame bar }% \fi% if empty } \newbox\FIMAbox \setbox\FIMAbox\vbox{% \hrule\@height.625in\@width.031in} \setbox\FIMAbox\hbox{\copy\FIMAbox \hskip.0315in\copy\FIMAbox\hskip.1565in% \copy\FIMAbox\hskip.1565in% \copy\FIMAbox\hskip.0315in\copy\FIMAbox} \newif\if@FIMA \newbox\AddressBox \newbox\FromBox \setbox\FromBox\null % font used for printing the address \let\addressfont\twlsf \def\EnvMakeBox#1#2{ \setbox#1\vbox{ \parindent0pt \leftskip0pt \lineskip1pt \baselineskip14pt \rightskip\@flushglue \addressfont #2} } \def\envaddress#1{\EnvMakeBox\AddressBox{#1}} \def\from#1{\EnvMakeBox\FromBox{#1}} \def\envelope{ \@FIMAfalse \gdef\zipcode{\empty} \setbox\PostNetBox\null \setbox\AddressBox\null } \def\endenvelope{ \newpage \if@FIMA \vbox to 0pt{ \hbox to \hsize{\hfill \copy\FIMAbox\hskip2in} \vss} \fi % These magic numbers are for my stationery \vbox{\vskip.435in\hbox{\hskip.32in\copy\FromBox}} \vfill \vbox to0pt{\vss % Address is 1 inch from the left % and 1 inch from the bottom \hbox{\hskip1in\box\AddressBox} \vskip.375in} \vbox to .625in{ \vfill \hbox to \hsize{ \hfill \hbox to 3.875in{ \unhbox\PostNetBox\hfill}} \vskip.25in }} ---- env.tex (example of using it) \documentstyle[env]{article} \nofiles \textwidth9.5in \textheight4.125in \pagestyle{empty} \begin{document} \from{Dimitri Vulis} \begin{envelope} \ZipBar{10036-8099} \envaddress{ Dimitri Vulis\\ Department of Mathematics/Box 330\\ Graduate School \& University Center\\ City University of New York\\ 33 West 42 Street\\ New York, New York\quad\zipcode % or only: %New York, New York\quad10036 } \end{envelope} \end{document} Dimitri Vulis, D&M BITNET: DLV@CUNYVMS1 Internet: DLV@CUNYVMS1.GC.CUNY.EDU Snail: Department of Mathematics/Box 330 City Univesrity of New York Graduate Center 33 West 42 Street New York, NY 10036-8099 USA