Page 1 of 1

Sending an attachment with email using JCL job

Posted: Wed Oct 22, 2008 12:23 pm
by sampada
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 :roll: . 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

Posted: Wed Oct 22, 2008 12:32 pm
by Natarajan
Can you give details of what program you are using to send mail.
give step details.

Posted: Sun Nov 23, 2008 9:31 am
by Anuj Dhawan
Hi,

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&#58; <MAINFRAME@********> 
RCPT TO&#58; <Anuj@********> 
DATA 
FROM&#58;     MAINFRAME@******** 
TO&#58;       Anuj  
SUBJECT&#58;  TEST ATTACHMENT 
MIME-VERSION&#58; 1.0 
CONTENT-TYPE&#58; TEXT/PLAIN 
CONTENT-DISPOSITION&#58; ATTACHMENT; FILENAME=FILE.TXT 
//       DD DSN=XXXXXX.JCL.CNTL&#40;EMAILATT&#41;,DISP=SHR 
//       DD DSN=XXXXXX.JCL.CNTL&#40;EMAILAT&#41;,DISP=OLD

Posted: Tue May 05, 2009 4:18 pm
by udaya00
Hi,
Use dataset for first DD in SYSUT1 instead of instream data.

let me know if any probs
uday

Posted: Wed May 06, 2009 1:53 pm
by Anuj Dhawan
udaya00 wrote:Use dataset for first DD in SYSUT1 instead of instream data.
What difference does that make?

Posted: Wed Nov 25, 2009 9:33 pm
by upendra_water
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.

IEBGENER - jcl to email an attachment

Posted: Sat Jun 18, 2011 12:58 pm
by Srini D
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

Re: IEBGENER - jcl to email an attachment

Posted: Sat Jun 18, 2011 8:10 pm
by Anuj Dhawan
Srini D wrote:I don't get the attachment, instead I get the attachment text in the body of the email.
Possibly, in your Outlook you are using "Rich-text" or "plain text" format.

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.

Re: IEBGENER - jcl to email an attachment

Posted: Mon Jun 02, 2014 9:56 pm
by naga821
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
Hi,
I am using same code, My JCL ran successfully but I did not get any mail. Please advice.

Thanks,
naga.

Posted: Thu Jun 05, 2014 1:00 pm
by NicC
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?

Topic deleted by Admin

Posted: Wed Feb 03, 2016 12:51 am
by academyindia4
<< Content deleted By Admin >>