4 Replies Latest reply: May 15, 2014 10:09 AM by elginreigner _ RSS

    How to deal with addresses in a report that can span 2 or 3 lines

    MonUserCJ _

      Hey all,


      I'm having difficulty trapping address data that can span either 2 or 3 lines. This is usually because sometimes the first line of an address is the name of an institution. I'll give an example of the record I'm looking at:


      SMITH MD       ROBERT    <---- Detail line

      City Hospital

      55 Tree Lane

      Danville, VA 24540


      One difficulty is that it's hard to define a trap that picks up on the first line of an address without picking up on the subsequent address lines as separate instances of the trap.


      What I've tried to do to get around this is to make a 3-line trap and trap on the state abbreviation on the third line (e.g. VA--there are only a couple of different states in the report).


      The issue is, this is causing problems for the addresses that appear on 2 lines. I have the address template as a footer that clears by the detail line above it. I was hoping that, in cases where the template is trapping too much because it's a 3 line trap being applied to a 2 line address, it would trap up until the detail trap. Something isn't working, though, because most of my address fields are coming up blank.


      The other thing I was trying to do was trap on the first line of the address (again, this is problematic) and have the trap end on "None of the above" in the advanced tab. This is nice, because it seems to handle the different lengths better.


      I guess I have a couple of questions. One--does anyone know why most of my address traps are coming up blank? If you define a 3 line template that traps on some characters in the third line, how does Monarch behave when the trap character appears 2 lines under the detail line instead of 3?


      Also, is there a way to trap up an indeterminate number of lines until the next template is encountered? It seems like you can do this downwards in a report (i.e. keep trapping lines until another template is encountered), but I don't see a way to trap up from a trap string on the third line. I thought that maybe beginning the trap "After last defined field" would do this, but it isn't working that way.


      Can anyone provide any advice on how to deal with reports formatted in this way? I would greatly appreciate it. Thanks.

        • How to deal with addresses in a report that can span 2 or 3 lines
          Grant Perkins

          Two things to read up on (the Help files or even the Tutorial Guide are recommended here since this can be a complicated discussion and they cover the options rather well.)


          You can use the Address block wizard in a couple of ways depending on how you can trap the fields. Usually this would start with seeking a multi-row address field with a variable number of lines.


          Or, in the example you have outlined, there may be a place for using the older concept of a Postal Code trap to spot the last line of your address block and work back from that.


          Address data can be very erratic and to be honest I have usually found anomalies in most address content that means automated parsing can be the subject of high error rates. This is probably why Monarch allows error codes in address block processing - if anomalies cannot be eliminate they can at least be made visible.


          If you have already been through the Address related sections of the help files but cannot find a solution we may need to spend some time with a real example containing several records to come up with some further specific suggestions.


          Alternative trapping approaches would seem to be a first line of investigation.