View previous topic :: View next topic
|
Author |
Message |
link.pradeep
New User
Joined: 21 Dec 2006 Posts: 7 Location: delhi
|
|
|
|
Hi All
i have e-mail ID of customer's and i want to extract the domain name from E-mail ID through unstring with pointer verb. Plz suggest me.
Ex xxx.yyy@yahoo.com --- yahoo
aaa.bbb@yahoo.co.in --- yahoo |
|
Back to top |
|
|
Raphael Bacay
New User
Joined: 04 May 2007 Posts: 58 Location: Manila, Philippines
|
|
|
|
Hi!
Can you try
UNSTRING FIELD-A DELIMITED BY '@' AND '.'
INTO FIELD-DOMAIN.
Thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
A bit more definition please.
Do you want whatever value is between the @ and the first period after the @? What should be the output of admin@mega.service.com or John.A.Smith@uth.tmc.edu
You mentioned "pointer". Is there some requirement for this, or were you just thinking out loud? |
|
Back to top |
|
|
stodolas
Active Member
Joined: 13 Jun 2007 Posts: 632 Location: Wisconsin
|
|
|
|
I know of people who have addresses like JohnSmith@mail.yahoo.com. What is the output here? mail, yahoo, com, mail.yahoo, yahoo.com, mail.yahoo.com?
Email addresses are horrendous for parsing. An @ character is valid in the first part of an email address if it is written like this "John@Smith"@yahoo.com (I think that is the format. RFC 822 or 2822 defines the valid format of an email address). If you were to unstring this using @ you wouldn't get what you want either. If COBOL could handle regular expressions, life gets somewhat easier for parsing and validating email address, but it is still "not cool". |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
As with most things, before we can offer usable suggestions, we need to know all of the rules. . .
Keep in mind that to do what you need may take more than one statement. It may be necessary to determine in which format a particular string "fits", then using the rules for that format, the needed value(s) can be "parsed" from the string. |
|
Back to top |
|
|
|