|
|
| Author |
Message |
bhanu bade
New User
Joined: 21 Jun 2005 Posts: 1 Location: India, pune
|
|
|
|
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 |
|
 |
References
|
|
 |
mdtendulkar
Active User
Joined: 29 Jul 2003 Posts: 257 Location: USA
|
|
|
|
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 |
|
 |
|
|
|