Re: If you were inventing CoBOL...

From: Peter Lacey (lacey_at_mb.sympatico.ca)
Date: 02/05/05


Date: Fri, 04 Feb 2005 20:27:28 -0600

j6vflbl6vy6g8o001@sneakemail.com wrote:
>
> Sure, and I said that in my original post, i.e. "... with a series of
> 88-level items...". But, consider how much work that takes!
>
> For example, I work a lot with phone numbers, especially in doing
> conversions, where the data quality coming in is usually suspect. So I
> have to identify "valid" phone numbers from invalid. Here's some
> formats I consider valid:
>
> * Formats Considered Valid:
> * -------------------------
> * (999) 999-9999
> * (999)999-9999
> * 999-999-9999
> * 999.999.9999
> * 999 999-9999
> * 999/999-9999
> * 9999999999
>

For this particular case, it would be just as easy to extract the
numeric characters, from right to left, placing them in a receiving
field from right to left; then examine the 3, 3, & 4 digit portions
(using REDEFINE). The first can be blank or numeric, the other two must
be numeric.

I'm not claiming anything for this method except to say: there are
almost always several different ways to attack a problem.

PL



Relevant Pages

  • Re: If you were inventing CoBOL...
    ... >> conversions, where the data quality coming in is usually suspect. ... I'm sure they have enough edits in their systems to want to standardize. ...
    (comp.lang.cobol)
  • Re: If you were inventing CoBOL...
    ... > conversions, where the data quality coming in is usually suspect. ... Even worse, I used to work for a firm where we not only used words, but ...
    (comp.lang.cobol)
  • Re: If you were inventing CoBOL...
    ... where the data quality coming in is usually suspect. ... > formats I consider valid: ... > And, here's some cobol-esque ways of validating, e.g. this code ...
    (comp.lang.cobol)