Sending an attachment with email using JCL job
Moderators: Frank Yaeger, DikDude, Moderator Group
Sending an attachment with email using JCL job
Hi All,
I have created a job which sends a report file as an attchment with the mail. The attachemnt is a text file having size around 1 to 1.5MB. When I submit the job, S722 abend is coming but mail is also getting sent with truncated file in the attachment . I have tried many things to increase possible size of the attachement I can send with tha mail, but not succeded. Can anyone help me in this?
-Sampada
I have created a job which sends a report file as an attchment with the mail. The attachemnt is a text file having size around 1 to 1.5MB. When I submit the job, S722 abend is coming but mail is also getting sent with truncated file in the attachment . I have tried many things to increase possible size of the attachement I can send with tha mail, but not succeded. Can anyone help me in this?
-Sampada
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
Hi,
This code sends the data as a text attachment:
This code sends the data as a text attachment:
Code: Select all
//MAILPROC EXEC PGM=IEBGENER
//SYSABEND DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(9,SMTP)
//SYSIN DD DUMMY
//*
//SYSUT1 DD *
HELO MAINFRAME.********
MAIL FROM: <MAINFRAME@********>
RCPT TO: <Anuj@********>
DATA
FROM: MAINFRAME@********
TO: Anuj
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE.TXT
// DD DSN=XXXXXX.JCL.CNTL(EMAILATT),DISP=SHR
// DD DSN=XXXXXX.JCL.CNTL(EMAILAT),DISP=OLD
Regards,
Anuj
Anuj
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
-
- Member
- Posts: 1
- Joined: Wed Nov 25, 2009 11:38 am
- Location: India
I am facing same problem mentioned above. The attachment is text file of size around 2MB. In my case the job executes successfully but when I get a report it is truncated; I mean many rows from the bottom side are deleted.
I even tried to zip the text file but I am unable to unzip the file when I receive a mail.
What I am looking for is:
a) Is there any way to send files having high size.
b) The correct syntax for zipping the attachment so that there us no problem at user's end while unzipping the file.
Any help in thus regards is highly appriciated.
I even tried to zip the text file but I am unable to unzip the file when I receive a mail.
What I am looking for is:
a) Is there any way to send files having high size.
b) The correct syntax for zipping the attachment so that there us no problem at user's end while unzipping the file.
Any help in thus regards is highly appriciated.
IEBGENER - jcl to email an attachment
Hello,
I am trying to email an attachment from mainframe using IEBGENER. My JCL is:
//MAILPROC EXEC PGM=IEBGENER
//SYSABEND DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(A,SMTP)
//SYSIN DD DUMMY
//*
//SYSUT1 DD DSN=USERID.INPUT.CARDS,DISP=SHR
// DD DSN=USERID.DCOL.DATASETS,DISP=SHR
Content of USERID.INPUT.CARDS is as below:
HELO MAILST1
MAIL FROM: <NAME@COMPANY.COM>
RCPT TO: <NAME@COMPANY.COM>
DATA
FROM: <NAME@COMPANY.COM>
TO: <NAME@COMPANY.COM>
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-DISPOSITION:ATTACHMENT;FILENAME="TEXT_FILE.TXT"
CONTENT-TYPE: TEXT/PLAIN
This JCL is working well, but if I put some text in the body of the USERID.INPUT.CARDS, I don't get the attachment, instead I get the attachment text in the body of the email.
Any help on getting this work, please?
Thanks,
Srini
I am trying to email an attachment from mainframe using IEBGENER. My JCL is:
//MAILPROC EXEC PGM=IEBGENER
//SYSABEND DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(A,SMTP)
//SYSIN DD DUMMY
//*
//SYSUT1 DD DSN=USERID.INPUT.CARDS,DISP=SHR
// DD DSN=USERID.DCOL.DATASETS,DISP=SHR
Content of USERID.INPUT.CARDS is as below:
HELO MAILST1
MAIL FROM: <NAME@COMPANY.COM>
RCPT TO: <NAME@COMPANY.COM>
DATA
FROM: <NAME@COMPANY.COM>
TO: <NAME@COMPANY.COM>
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-DISPOSITION:ATTACHMENT;FILENAME="TEXT_FILE.TXT"
CONTENT-TYPE: TEXT/PLAIN
This JCL is working well, but if I put some text in the body of the USERID.INPUT.CARDS, I don't get the attachment, instead I get the attachment text in the body of the email.
Any help on getting this work, please?
Thanks,
Srini
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
Re: IEBGENER - jcl to email an attachment
Possibly, in your Outlook you are using "Rich-text" or "plain text" format.Srini D wrote:I don't get the attachment, instead I get the attachment text in the body of the email.
Try:
1. From the main Outlook window, on the Tools menu, click Options, and then click the Mail Format tab.
2. Click Internet Format.
3. Under Outlook Rich Text options, select the HTML format.
Regards,
Anuj
Anuj
Re: IEBGENER - jcl to email an attachment
Hi,Srini D wrote:Hello,
I am trying to email an attachment from mainframe using IEBGENER. My JCL is:
//MAILPROC EXEC PGM=IEBGENER
//SYSABEND DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(A,SMTP)
//SYSIN DD DUMMY
//*
//SYSUT1 DD DSN=USERID.INPUT.CARDS,DISP=SHR
// DD DSN=USERID.DCOL.DATASETS,DISP=SHR
Content of USERID.INPUT.CARDS is as below:
HELO MAILST1
MAIL FROM: <NAME@COMPANY.COM>
RCPT TO: <NAME@COMPANY.COM>
DATA
FROM: <NAME@COMPANY.COM>
TO: <NAME@COMPANY.COM>
SUBJECT: TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-DISPOSITION:ATTACHMENT;FILENAME="TEXT_FILE.TXT"
CONTENT-TYPE: TEXT/PLAIN
This JCL is working well, but if I put some text in the body of the USERID.INPUT.CARDS, I don't get the attachment, instead I get the attachment text in the body of the email.
Any help on getting this work, please?
Thanks,
Srini
I am using same code, My JCL ran successfully but I did not get any mail. Please advice.
Thanks,
naga.
1) you should strt a new topic - you can cross-reference it to this.
2) If you used that exact code then it is no wonder that you did not get an email unless your email address really is name@company.com and your file name really is text_file.txt
3) Have you checked with your systems group that A,SMTP is the correct class and process for emailing at your shop?
2) If you used that exact code then it is no wonder that you did not get an email unless your email address really is name@company.com and your file name really is text_file.txt
3) Have you checked with your systems group that A,SMTP is the correct class and process for emailing at your shop?
Regards
Nic
Nic
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