IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

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: 2429
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: 8568
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

Active Member


Joined: 29 Apr 2008
Posts: 876
Location: Maryland

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: 8568
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 All times are GMT + 6 Hours
Forum Index -> JCL & VSAM
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts TXT2PDF and then SMTP email a PDF JCL & VSAM 4
No new posts Fetch the Dataset names from inside m... TSO/ISPF 18
No new posts Pack to Unpack conversion for sending... COBOL Programming 13
No new posts Send email without SMTP All Other Mainframe Topics 5
No new posts Search the strings present in ps file... All Other Mainframe Topics 8

Back to Top