[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: E-mail generator



Sam,
Try this:

1. Drive from table:
-----------------
begin-report
do main
end-report

begin-procedure main
begin-select
lower(substr(spriden_first_name,1,1)) &first
lower(spriden_last_name) &last
let $last = translate(&last,' -''''','') ! Remove ',-,space.
let $email = substr(&first||$last,1,8) ! Limit only 8 chars.
print $email (+1,1)
from spriden
where spriden_change_ind is null
and (spriden_last_name like '%''%'
or spriden_last_name like '%-%'
or spriden_last_name like '% %')
and SPRIDEN_ENTITY_IND = 'P'
end-select
end-procedure main

Drive from flat file with ',' delimiter:
----------------------------------------
begin-report
do main
end-report

begin-procedure main
input $data_file 'Enter data file with full path'
let $data_file = '/home/iss/ble/ben.data'
OPEN $data_file AS 1 FOR-READING record=150:vary status=#filestat
if #filestat !=0 ! file does not exists
stop quiet
end-if

while 1
READ 1 into $line:5000
if #end-file
break
end-if
UNSTRING $line BY ',' into $last1
$first1
do print
end-while
end-procedure main
begin-procedure print
let $last2 = translate($last1,' -''''','') ! Remove ',-,space.
let $first2= substr($first1,1,1)
lowercase $last2
lowercase $first2
let $email = substr($first2||$last2,1,8) ! Limit only 8 chars.
print $email (+1,1)
end-procedure print

I hope this help!

>>>>
-----Original Message-----
From: Sam Spritzer [<mailto:SSpritzer@GW.CTG.COM>mailto:SSpritzer@GW.CTG.COM]
Sent: Thursday, April 22, 1999 3:55 PM
To: Multiple recipients of list SQR-USERS
Subject: E-mail generator

I m in the process of creating an e-mail generator which will take an
employee's name and create the user part of an e-mail address. The
requirement is to take the first letter of the first name and marry it to
the last name. For example, Bill Clinton would be bclinton.
Straight names are easy...its the non-letter characters I am having trouble
with such as O'Gore,Al / de Agnew, Spiro / Rodham-Clinton,Hillary.
Does anyone have a "stripper/scrubber" code that they would be willing to
share?
Thanks in advance,
Sam


Benjamin Le
System Development, ITS
Portland Community College
PO Box 19000 Portland, OR. 97280-0990 U.S.A.
Phone: (503)-977-4970 Fax:(503)-977-4987
E-mail: Mailto:ble@pcc.edu
PCC Web: http://www.pcc.edu