-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Craig Jacobsen
Sent: Wednesday, August 30, 2006 1:36 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: Converting names & street names


Ok, had a lot of requests for the code.  I'm not positive it works in every
example, but it's pretty easy to change for conditions.  I modified it
recently (parms) put it is still pretty much RPG/400:

     H  Option(*NoDebugIO) Debug(*Yes)
      *
     D* Parms
     D Passed_Parms    PR                  ExtPgm('CVTCASE')
     D  Parm_String                 132A

     D Passed_Parms    PI
     D  Parm_String                 132A

     D SpcFlg          S              1
     D Stop            S              3  0
     D X               S              3  0
     D Mc              S              3  0

     D String          DS
     D  S                      1    132    Dim(132)

     D Up              C                   Const('ABCDEFGHIJKLMNOPQRST-
     D                                     UVWXYZ')
     D Lo              C                   Const('abcdefghijklmnopqrst-
     D                                     uvwxyz')
      * ============================================================*
      *                M A I N L I N E                              *
      * ============================================================*
     C                   Eval      String = Parm_String
      *
      * If blank, can't process
     C                   If        String = *Blanks
     C                   Return
     C                   EndIF

      * make all lower case
     C     Up:Lo         XLate     String        String

      * if starts with Mc force 3 letter to be caps
     C                   Eval      Mc = 0
     C     'mc'          Scan      String        Mc
     C                   If        Mc > 0
     C                   Eval      Mc = Mc + 1
     C                   EndIf
      * get stopping point
     C                   Eval      Stop = 132
     C     ' '           Checkr    String        Stop

      * Make first letters upper case
     C                   Eval      SpcFlg = *On
      *
     C                   Do        Stop          x
      *
     C                   If        SpcFlg = *On  and
     C                             S(x)  <> ' '  and
     C                             S(x)  <> '*'
      *
     C     Lo:Up         XLate     S(x)          S(x)
      *
     C                   Eval      SpcFlg = *Off
      *
     C                   EndIf
      *
     C                   If        SpcFlg = *Off
      *
     C                   If           S(x) = ' '
     C                             or S(x) = '.'
     C                             or S(x) = '#'
     C                             or S(x) = '*'
     C                             or S(x) = '&'
     C                             or S(x) = '/'
     C                             or S(x) = '-'
     C                             or S(x) = ','
     C                             or S(x) = '('
     C*                            or S(x) = ''''
     C                             or X    = Mc
     C                   Eval      SpcFlg = *On
     C                   EndIf
      *
     C                   EndIf
      *
     C                   EndDo

     C                   Eval      Parm_String = String
     C                   Return

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Shore
Sent: Wednesday, August 30, 2006 4:21 PM
To: Midrange Systems Technical Discussion
Subject: RE: Converting names & street names


Thanks for your reply Tommy, but the main problem I am going to have is
with the names like
O'Donnell
McGuyver
etc
where the name contains more than one upper case character.
When I worked on a mainframe, using COBOL, we had to do the same thing in
converting from upper case to mixed case, and we ended up with literally
THOUSANDS of names like these that did not fit a straight conversion. These
we had to place in a special file to cross-reference them to how they
should be printed on a letter.
Now this was more years ago than I care to remember, and the mainframe (and
the bank) no longer exist.
I admit, I AM being lazy, and if I had to, I could go through the routine
of re-creating this special file on the AS/400 (or i5, i-series or whatever
its now called) but if someone already has this available (and is willing
to share) ............

Thanks


Alan Shore

NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx

midrange-l-bounces@xxxxxxxxxxxx wrote on 08/30/2006 03:57:17 PM:

I have run this for a long time so I'm not sure what state it's
in....but it should be a good start.


Thanks,
Tommy Holden


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Shore
Sent: Wednesday, August 30, 2006 2:53 PM
To: Midrange Systems Technical Discussion
Subject: Converting names & street names

Afternoon all,
we hold our customer name and address in upper case. We want to create
letters to these customers, but we want to convert the name and address
to
mixed case, so that the name looks like

SMITH             converts to       Smith
which is fairly straight forward, however,
O'DONELL    converts to       O'Donell
MCGUYVER    converts to McGuyver
plus others could provide problems.
My question is :-
does anyone have/know of a routine and/or 3rd party vendor that would
handle the conversion of names and addresses from upper case to mixed
case?

Thanks in advance



Alan Shore

NBTY, Inc
(631) 244-2000 ext. 5019
AShore@xxxxxxxx
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

[attachment "cvtchar.txt" deleted by Alan Shore/NBTY] --
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.