Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Unstring operation: extract the domain name from E-mail ID

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
link.pradeep

New User


Joined: 21 Dec 2006
Posts: 7
Location: delhi

PostPosted: Tue Aug 07, 2007 11:15 am    Post subject: Unstring operation: extract the domain name from E-mail ID
Reply with quote

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
View user's profile Send private message

Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Tue Aug 07, 2007 12:07 pm    Post subject:
Reply with quote

Hi!

Can you try

UNSTRING FIELD-A DELIMITED BY '@' AND '.'
INTO FIELD-DOMAIN.


Thanks.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Aug 07, 2007 9:45 pm    Post subject:
Reply with quote

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 icon_question.gif

You mentioned "pointer". Is there some requirement for this, or were you just thinking out loud?
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Tue Aug 07, 2007 10:34 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Aug 08, 2007 2:24 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the Extract Function in JCL dharmaraok JCL & VSAM 3 Wed Jun 14, 2017 9:12 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Mail via SMTP with an image? Mike 1304 JCL & VSAM 4 Thu Jan 26, 2017 2:01 pm
No new posts Joinkeys operation when key1 and key2... Susanta DFSORT/ICETOOL 5 Wed Nov 02, 2016 5:35 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us