Validate email ID

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Validate email ID

Post by RAJARP »

Hi all,
In my parallel job, i need to validate email ids coming from source.What are all the things do i need to check whether the email id is valid? i am having
1.checking for the presence of symbol @ and
2.checking for spaces in the id, if any
in my mind.I am thinking of doing all these validations in a transformer stage.kindly suggest.

Example data:
No ID
1 raja@yahoo.com----->this is an valid id
2 ramyahoo-------------> this is an invalid id

Thanks & Regards,
Raja R P
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Use Index function to search for @ and space
You are the creator of your destiny - Swami Vivekananda
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you have QualityStage licensed you can use the VEMAIL rule set.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's a heck of a lot more to it than that, but Index would give you a minimal check. All kinds of regexp samples posted on the 'net for stuff like this - email, phone number, etc which a search should turn up. May help... may not. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
agpt
Participant
Posts: 151
Joined: Sun May 16, 2010 12:53 am

Post by agpt »

you can check few other things also for example:
1) there is only one and only one @ symbol available in email id
2) no occurrence of two consecutive periods i.e. (..)
antonyraj.deva
Premium Member
Premium Member
Posts: 138
Joined: Wed Jul 16, 2008 9:51 pm
Location: Kolkata

Post by antonyraj.deva »

agpt wrote:you can check few other things also for example:
1) there is only one and only one @ symbol available in email id
2) no occurrence of two consecutive periods i.e. (..)
You can add an indexed lookup for the known Mail service providers to the above two checks for better results. :wink:

Thanks,
Tony
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

viewtopic.php?t=132811&highlight=

use the code in this post by DSGuru2B to start. you can put the dynamic array in stage variable. Create the varaibles used in the routine as stage variables and then do the checks in another stage variable.

also you can use index function to locate mail extention, but instead of searching for '.ed' search for ',.ed,' with leading and trailing delimiter, you should add leading and trailing delimiter in dynamic array too.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
RAJARP
Participant
Posts: 147
Joined: Thu Dec 06, 2007 6:46 am
Location: Chennai

Post by RAJARP »

Hi,
Thanks for all.I have used parts of DSGuru2B's code and validated Email ids.

Regards,
Raja R P
Post Reply