QTP Converting surnames : SMITH-HENDERSON to Smith-Henderson

David Morrison - Corporate dmorrison@mcbrideelectric.com
Tue, 14 Dec 2004 09:57:08 -0800


Seamus,

This is the kind of problem that lends itself to solving via QUICK, if you can do that.  (We had a discussion on this forum recently about this issue, where I spoke up for this!)

Set up a DO loop where you examine each character in the name one at a time (working left to right), to determine if it should be capitalized (capitalised!) or not.  You set the rules as you wish; I think yours are:

1. First letter of the name is upper case
2. First letter immediately after a space or hyphen is upper case
3. Every other letter is lower case

Way easier to test and to maintain than using QTP would be.

Thanks.

Cordially,

David Morrison

-----Original Message-----
From: powerh-l-admin@lists.sowder.com
[mailto:powerh-l-admin@lists.sowder.com]On Behalf Of Seamus Browne
Sent: Tuesday, December 14, 2004 9:29 AM
To: powerh-l@lists.sowder.com
Subject: QTP Converting surnames : SMITH-HENDERSON to Smith-Henderson


Hi all,
Thanks for the info on Quiz and the 256 char limit on page width.
The problem solved is now using QTP, as suggested here yesterday.

Today's pb is about surnames aka "family names".
All our surnames are in block capitals.
SMITH 
JONES
GALBRAITH
Etc.

I would like to get them into this kind of style 
Smith 
Jones
Galbraith
Aka "Initialised"

I can manage that myself using UPSHIFT on the first letter and downshift
on the rest.

But records which have combined surnames such as 
	SMITH-HENDERSON
	WITHERBY-JONES 
	HUDSON MCGINTY
	UGADA BUGADA
are giving me  headache.

Some records have these combined surnames with hyphens, others just with
spaces.

How can I get QTP to transform 
	SMITH-HENDERSON
	WITHERBY-JONES 
	HUDSON MCGINTY
	UGADA BUGADA
into 
	Smith-Henderson
	Witherby-Jones 
	Hudson McGinty
	Ugada Bugada   ????

And where in my current prog would I do the replacing ?
Here's the (snipped) prog as it is.

------------------------------
Can cle
Set def

:purge  lclient
:purge  lclientq

acc clients
set process limit 200;000

temp TBL-NUM INT SIZ 2 
Item TBL-NUM        = 9

Temp TBL     CHAR *  1 
Item TB    = CHAR(TBL-NUM)[2:1]

Temp    a-Client-num    varchar * 8  
Item    a-Client-num  = trunc(asc(Client-num ,6)) + trunc(tbl)

Temp    a-Client-Surname varchar * 34
item    a-Client-Surname = trunc(Client-Surname) + trunc(tbl)
...

Temp packet varchar * 760  
Item packet   =                            &,

  trunc(a-Client-num              +        &,
        a-Client-Surname          +        &,
....
       )        

subfile lclient   portable keep            &,
include packet 

go

:print lclientq

----------------------------------------

TIA

Scottie Hannigan.



= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l@lists.sowder.com
Subscribe: "subscribe" in message body to powerh-l-request@lists.sowder.com
Unsubscribe: "unsubscribe <password>" in message body to powerh-l-request@lists.sowder.com
http://lists.sowder.com/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.