MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How exactly to inspect the mail-id in the given scenario

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
me_naveen
Beginner


Joined: 21 Dec 2007
Posts: 23
Topics: 12

PostPosted: Mon Jun 25, 2018 1:20 am    Post subject: How exactly to inspect the mail-id in the given scenario Reply with quote

Hi,

I have a field such as mail-id. Need to validate as below.

mail-id new rule as:

mail id could have comment also included(optional).But , in case if included
could be included at start or end of the local part of the mail-id(before @ symbol).

Examples as
subject(comment)@sub.com ==> VALID
(comment)subject@sub.com ==> VALID

sub(comment)ject@sub.com ==> Invalid ( '(comment)' is included in the local part other than start or end of local part of the mail-id.

In case comment such as (comment) comes other than start or end of the mail-id , it should throw an error.

How could I implement such logic.

Thanks in advance.
Nav
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Jun 25, 2018 3:56 am    Post subject: Reply with quote

You do not mention which programming language you are using so this is a generic answer:
Code:
Split the line at the @ sign
Check that there is a '(' in the first string
If yes
   If the first character is '@' or the last character is ')'
   Then OK
   Else give error (do not 'throw' an error as errors are not 'throw' on the mainframe)

_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
me_naveen
Beginner


Joined: 21 Dec 2007
Posts: 23
Topics: 12

PostPosted: Mon Jun 25, 2018 5:18 am    Post subject: Reply with quote

Hi,

Sorry for not including the Programming Language.

This is for COBOL.

Thanks,
Nav
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Jun 25, 2018 8:16 am    Post subject: Reply with quote

Still. that spec will work for a routine written in COBOL.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group