Need to send Attachment in mail thru JCL.
Moderators: Frank Yaeger, DikDude, Moderator Group
Need to send Attachment in mail thru JCL.
Hi Guru's,
Requirement--> Send a notepad attachment to USER@xxx.com along with notepad populated with records in GDG file created in previous step.
Success:I have created a jcl which is able to send a notepad attachment to desired mail address.
Fail: I falied to copy the GDG(0) in this notepad.
//JS000020 EXEC MAILOUT,COND=(04,LT)
//*MAIL DD DSN=IS00711.E.CNTLCARD(AUTOMAIL),DISP=SHR
//MAIL DD DISP=SHR,
// DSN=IS00711.E.CNTLCARD(ATOMAIL1)
// DD DISP=SHR,
// DSN=IS00711.E.MC00JCL5.LCX4.T705LOD(+0)
//
********contents of ATOMAIL1************************
xxx.xx.x.143
TO: XXXXX@headstrong.com
DATA
SUBJECT: automation testing
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED;
BOUNDARY="----_=_NEXTPART_000_01C0DFAD.3EF4A2D0"
This message is in MIME format. Since your mail
reader does not understand this format, some or
all of this message may not be legible.
Body is in HTML format...
------_=_NEXTPART_000_01C0DFAD.3EF4A2D0
CONTENT-TYPE: text/html
<font face="ARIAL" color="#0000FF" size="2">
Testing automation. <br>
MEDS704 bakcup <br>
</font>
------_=_NEXTPART_000_01C0DFAD.3EF4A2D0
CONTENT-TYPE: TEXT/PLAIN;
name="MEDS704.txt"
********************************************************
This content can send me mail but i am not able to copy a data set DSN=IS00711.E.MC00JCL5.LCX4.T705LOD(+0) to my notepad attachment.
-----------------------------------------------------------------------------------
I alos tried with IEBGENER as suggested in other posts in this site.
//JS000010 EXEC PGM=IEBGENER
//OUTPUT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DISP=SHR,
// DSN=IS00711.E.CNTLCARD(AUTOMAIL) -->Same as above
// DD DISP=SHR,
// DSN=IS00711.E.AUTOMCL5.TEST1
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//*
//*
//* SEND EMAIL CONCAT. HEADER / DATA / TRAILER.
//*----------------------------------------------
but this doesnt send me any mail. anybody care to suggest as this is the first time i am working with MIMe and mail attachments.
Thanks in advance.
Requirement--> Send a notepad attachment to USER@xxx.com along with notepad populated with records in GDG file created in previous step.
Success:I have created a jcl which is able to send a notepad attachment to desired mail address.
Fail: I falied to copy the GDG(0) in this notepad.
//JS000020 EXEC MAILOUT,COND=(04,LT)
//*MAIL DD DSN=IS00711.E.CNTLCARD(AUTOMAIL),DISP=SHR
//MAIL DD DISP=SHR,
// DSN=IS00711.E.CNTLCARD(ATOMAIL1)
// DD DISP=SHR,
// DSN=IS00711.E.MC00JCL5.LCX4.T705LOD(+0)
//
********contents of ATOMAIL1************************
xxx.xx.x.143
TO: XXXXX@headstrong.com
DATA
SUBJECT: automation testing
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED;
BOUNDARY="----_=_NEXTPART_000_01C0DFAD.3EF4A2D0"
This message is in MIME format. Since your mail
reader does not understand this format, some or
all of this message may not be legible.
Body is in HTML format...
------_=_NEXTPART_000_01C0DFAD.3EF4A2D0
CONTENT-TYPE: text/html
<font face="ARIAL" color="#0000FF" size="2">
Testing automation. <br>
MEDS704 bakcup <br>
</font>
------_=_NEXTPART_000_01C0DFAD.3EF4A2D0
CONTENT-TYPE: TEXT/PLAIN;
name="MEDS704.txt"
********************************************************
This content can send me mail but i am not able to copy a data set DSN=IS00711.E.MC00JCL5.LCX4.T705LOD(+0) to my notepad attachment.
-----------------------------------------------------------------------------------
I alos tried with IEBGENER as suggested in other posts in this site.
//JS000010 EXEC PGM=IEBGENER
//OUTPUT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD DISP=SHR,
// DSN=IS00711.E.CNTLCARD(AUTOMAIL) -->Same as above
// DD DISP=SHR,
// DSN=IS00711.E.AUTOMCL5.TEST1
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//*
//*
//* SEND EMAIL CONCAT. HEADER / DATA / TRAILER.
//*----------------------------------------------
but this doesnt send me any mail. anybody care to suggest as this is the first time i am working with MIMe and mail attachments.
Thanks in advance.
#1. We don't know what your MAILOUT PROC does.
#2. You honestly don't have software that you can use to handle this without YOU having to code SMTP and MIME instructions?
#3. There's no traces or debugging logs you can review?
#4. What is the standard procedure for doing this at your site? If I'm understanding your post, you HAVE sucessfully sent an email with an attachment? If so, then what's the difference?
#2. You honestly don't have software that you can use to handle this without YOU having to code SMTP and MIME instructions?
#3. There's no traces or debugging logs you can review?
#4. What is the standard procedure for doing this at your site? If I'm understanding your post, you HAVE sucessfully sent an email with an attachment? If so, then what's the difference?
Thanks MrSpock for quick response,
#2 I want this to be done automatically rather then going thru start 6.
#3 Rc is coming Zero if done with IEBGENER but no mail is turning out.
with sysprint info as follows.
OUTPUT LRECL = 80, BLKSIZE = 27920, TYPE = FB
INSERT 0, DELETE 0
RECORDS - IN: 25, OUT: 25
SMF RECORD NOT WRITTEN TO THE SMF DATA SET(RC=20)
END OF DFSORT
#4 In my site they dont send attachments in mail this is what i am trying to achieve. i am able to get the attachement but its an empty attachment. i want my gdg records in it. which is missing.
i have seen the posts here which has achieved the same with IEBGENER some how not working for me. need little help
#2 I want this to be done automatically rather then going thru start 6.
#3 Rc is coming Zero if done with IEBGENER but no mail is turning out.
with sysprint info as follows.
OUTPUT LRECL = 80, BLKSIZE = 27920, TYPE = FB
INSERT 0, DELETE 0
RECORDS - IN: 25, OUT: 25
SMF RECORD NOT WRITTEN TO THE SMF DATA SET(RC=20)
END OF DFSORT
#4 In my site they dont send attachments in mail this is what i am trying to achieve. i am able to get the attachement but its an empty attachment. i want my gdg records in it. which is missing.
i have seen the posts here which has achieved the same with IEBGENER some how not working for me. need little help
Have you seen this website, or followed some of it's advice?
http://planetmvs.com/mvsmail/index.html
http://planetmvs.com/mvsmail/index.html
Thanks,
Mr Spock its working for me.
My Fault--> I missed setting the boundary afte giving the filename. which made my notead not able to pick the records and concatenate in the notepad mime Dataset.
// DD DISP=SHR,
// DSN=IS00711.E.CNTLCARD(ATOMAIL1) -->HERE after filename i dint mention Boundary
// DD DISP=SHR,
// DSN=IS00711.E.MC00JCL5.LCX4.T705LOD(+0)
its wrking well now. thanks alot for all ur support. after this i realised the importance of Boundaries in MIME.
PHASE II
I have a similar requirement but instead of receiving notepad attachments i would like to get it on Spread sheet. with the records populated in correct column. Please let me know if this can be achieved thru chaning mime Content type?
Guru's Please give me some directions. Thanks in advance.
Mr Spock its working for me.
My Fault--> I missed setting the boundary afte giving the filename. which made my notead not able to pick the records and concatenate in the notepad mime Dataset.
// DD DISP=SHR,
// DSN=IS00711.E.CNTLCARD(ATOMAIL1) -->HERE after filename i dint mention Boundary
// DD DISP=SHR,
// DSN=IS00711.E.MC00JCL5.LCX4.T705LOD(+0)
its wrking well now. thanks alot for all ur support. after this i realised the importance of Boundaries in MIME.
PHASE II
I have a similar requirement but instead of receiving notepad attachments i would like to get it on Spread sheet. with the records populated in correct column. Please let me know if this can be achieved thru chaning mime Content type?
Guru's Please give me some directions. Thanks in advance.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page