IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

sending email from jcl using the mailid present inside a fil


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
niloyarp

New User


Joined: 04 Oct 2017
Posts: 1
Location: INDIA

PostPosted: Tue Oct 10, 2017 12:32 pm
Reply with quote

Hi,
My requirement is to process a file and send certain details via mail. The mailid is present in a certain file. How do i extract that mailid from the file and send it to that specific mailid.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Oct 10, 2017 3:45 pm
Reply with quote

You will be processing a data set not a 'file'. Read the data set, extract the mail id and write it to another data set. Use this data set as part of your mailing commands.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Oct 10, 2017 7:29 pm
Reply with quote

Quote:
How do i extract that mailid from the file and send it to that specific mailid.
Write a program in the language of your choice to read the data set and use it to create the SMTP commands to send an email; run the commands through SMTP (assuming it is running at your site -- most sites run SMTP these days). Note that the specific job class and writer name to use are site-dependent, so no one on this (or any) forum can tell you what to use for SMTP -- only someone working at your site can tell you those vital pieces of information. SYSOUT=(B,SMTP) is common but by no means universal!
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Wed Oct 11, 2017 2:50 am
Reply with quote

A Sample job for your reference.

Code:

//PSTEP01  EXEC PGM=SORT                         
//SORTIN DD *
abcd@bfgh.com 
eefg@hggg.com   
//SORTOUT  DD DSN=&&TEMP,                         
//            DISP=(,PASS,DELETE),               
//            UNIT=SYSDA,                         
//            SPACE=(CYL,(1,1),RLSE)             
//SYSIN  DD *
OPTION COPY                                                           
OUTFIL REMOVECC,HEADER1=('%XMITIP (-'),                               
       BUILD=(1,80,SQZ=(SHIFT=LEFT,LEAD=C'<',TRAIL=C'> -')),           
       TRAILER1=(') -',/,                                             
                 '   FROM  ABCD@EFGH.COM  -',/,     
                 '   NOMSG   -',/,                                     
                 '   FILEDD DDNAME1 -',/,                               
                 '       SUBJECT "REPORT FILE IS ATTACHED"')           
//SYSOUT DD SYSOUT=* 
//IKJEFT   EXEC PGM=IKJEFT01,                                       
//             DYNAMNBR=100                                         
//*                                                                 
//SYSIN    DD  TERM=TS                                               
//SYSEXEC  DD  DSN=(QUALIFIER).XMITIP.EXEC,      ==> your xmitip lib                           
//             DISP=SHR                                             
//SYSTSIN  DD  DSN=&&TEMP,DISP=(OLD,DELETE,DELETE)                   
//DDNAME1   DD  DSN=FILE.DATA,        ==>         your data file
//             DISP=SHR                                             
//SYSPRINT DD  SYSOUT=*                                             
//SYSTSPRT DD  SYSOUT=*                                             
//SYSTERM  DD  SYSOUT=*                                             
//SYSOUT   DD  SYSOUT=* 
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2018
Location: USA

PostPosted: Wed Oct 11, 2017 7:08 pm
Reply with quote

magesh23586 wrote:
A Sample job for your reference.

Code:
. . .

(Matthew 7:6) wrote:
The Principle: Casting Pearls Before Swine.

"Do not give what is holy to dogs, and do not throw pearls before swine, lest they trample them under their feet, and turn and tear you to pieces." .
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Oct 11, 2017 7:33 pm
Reply with quote

magesh23586, since XMITIP is not part of z/OS and must be installed as an independent software vendor product, what does niloyarp do if XMITIP is not installed at that site? Your JCL will be completely useless if XMITIP is not available, and not all sites have it installed.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts calling a JCl inside a JCL JCL & VSAM 3
No new posts SRCHFOR ‘string’ command inside P... TSO/ISPF 14
No new posts REXX to send an email in Mainframe wi... CLIST & REXX 3
No new posts REXX to send an email in Mainframe CLIST & REXX 4
No new posts To find an array of words (sys-symbol... JCL & VSAM 9
Search our Forums:

Back to Top