Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
E-mail editing and validation.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
bhanu bade

New User


Joined: 21 Jun 2005
Posts: 1
Location: India, pune

PostPosted: Tue Jun 21, 2005 3:08 pm    Post subject: E-mail editing and validation.
Reply with quote

Hi All,

I need how to validate email id in cobol pgm.

Question?

The input file which is coming from jcl is having card number, email id, address etc. what we need to do is we need to edit the email id and do validations like whether the email id is correct or wrong according to the email standards like the @ present or is there any spaces in between and .com or .org etc these type of validations needs to be done thru cobol pgm and if we found wrong we need to write it i out file1 and if it is correct write it on file2.


Regards
Bhanu
Back to top
View user's profile Send private message
References
mdtendulkar

Active User


Joined: 29 Jul 2003
Posts: 256
Location: USA

PostPosted: Tue Aug 09, 2005 5:25 am    Post subject: Re: E-mail editing and validation.
Reply with quote

bhanu bade,

Following is the algorithm you can use for checking the email address..

1) Accept the email id field
2) INSPECT the field to check if '@' is present in it, if not then set INVALID flag
3) INSPECT the field for any SPACES, if yes set INVALID flag
4) REVERSE the field
5) UNSTRING field by using FIRST '.' (PERIOD)
6) check valid email extension (.com, .net etc etc) before initial PERIOD.
if extension is not correct, then set INVALID Flag

7) check if INVALID flag is set, if yes then write to INVALID file else write to VALID file

Hope this helps,

Regards
Mayuresh
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 Hours
Page 1 of 1