Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : When you specified V for RECFM parameter, LRECL value is largest record in the file plus 4 bytes. These four bytes contain the actual length of each variable length record in the file

Google
 
Web mainframegurukul.com

Sending an attachment with email using JCL job

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL
  View previous topic :: View next topic  
Author Message
sampada
Member


Joined: 22 Oct 2008
Posts: 1

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Oct 22, 2008 12:23 pm    Post subject: Sending an attachment with email using JCL job Reply with quote

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 Rolling Eyes . 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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 537
Location: chennai

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Oct 22, 2008 12:32 pm    Post subject: Reply with quote

Can you give details of what program you are using to send mail.
give step details.
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sun Nov 23, 2008 9:31 am    Post subject: Reply with quote

Hi,

This code sends the data as a text attachment:
Code:
//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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
udaya00
Member


Joined: 08 Apr 2009
Posts: 6

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Tue May 05, 2009 4:18 pm    Post subject: Reply with quote

Hi,
Use dataset for first DD in SYSUT1 instead of instream data.

let me know if any probs
uday
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed May 06, 2009 1:53 pm    Post subject: Reply with quote

udaya00 wrote:
Use dataset for first DD in SYSUT1 instead of instream data.
What difference does that make?
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
upendra_water
Member


Joined: 25 Nov 2009
Posts: 1
Location: India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Nov 25, 2009 9:33 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Srini D
Member


Joined: 17 Jun 2011
Posts: 1

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sat Jun 18, 2011 12:58 pm    Post subject: IEBGENER - jcl to email an attachment Reply with quote

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
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Anuj Dhawan
Moderator


Joined: 09 Aug 2008
Posts: 1625
Location: Mumbai, India

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sat Jun 18, 2011 8:10 pm    Post subject: Re: IEBGENER - jcl to email an attachment Reply with quote

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.
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
naga821
Member


Joined: 02 Jun 2014
Posts: 1

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Mon Jun 02, 2014 9:56 pm    Post subject: Re: IEBGENER - jcl to email an attachment Reply with quote

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.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
NicC
Active Member


Joined: 24 Jul 2011
Posts: 650
Location: Down on the pig farm

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Jun 05, 2014 1:00 pm    Post subject: Reply with quote

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?
_________________
Regards
Nic
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
academyindia4
Guest





Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Wed Feb 03, 2016 12:51 am    Post subject: Topic deleted by Admin Reply with quote

<< Content deleted By Admin >>
Back to top
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-3559.html