Page 1 of 1

how to attach ps to email

PostPosted: Tue Jul 20, 2010 11:04 am
by shiva5977
this is the scenario,,,
can any one tell me now generated report i need to send it to customer where can i specify email id

Re: how to attach ps to email

PostPosted: Tue Jul 20, 2010 5:09 pm
by Robert Sample
First, you must contact your site support group to find out the name of the SMTP started task running at your site. This is usually SMTP but it does not have to be.

Second, you need to know the output class to use for emails -- often this is B but we use 9 (it all depends upon the site).

Third, you use JCL similar to this:
//MAILPGM  EXEC PGM=IEBGENER
//SYSABEND DD   SYSOUT=*
//SYSTOTAL DD   SYSOUT=*
//SYSLIST  DD   SYSOUT=*
//SYSPRINT DD   SYSOUT=*
//SYSUT2   DD   SYSOUT=(9,SMTP)  <== 9 AND SMTP BOTH DEPEND ON THE SITE
//SYSIN    DD   DUMMY
//*
//SYSUT1   DD  *
HELO your.mainframe.name
MAIL FROM: <abc@xyz.com>
RCPT TO: <who.gets.it@xxx.com>
DATA
From:     anything you want
To:       anything you want
Subject:  Test attachment
<optional text>
MIME-Version: 1.0
Content-Type: text/plain
Content-Disposition: attachment; filename=file.txt
//         DD   DISP=SHR,DSN=ATTACHMENT.DATA.SET
//         DD   *
.
/*
//
Note the attachment data set is assumed to be 80 byte LRECL. If it is not, you'll need to put the instream data into data sets with the same LRECL and concatenate them. Also note that 998 is the longest LRECL you're allowed to use. The trailing period is not optional -- if you don't have it, the email will not be sent.

Re: how to attach ps to email

PostPosted: Wed Oct 27, 2010 5:22 pm
by Bad Man
Note the attachment data set is assumed to be 80 byte LRECL. If it is not, you'll need to put the instream data into data sets with the same LRECL and concatenate them.


Can you please brief little more...I am thankful to you for passing this JCL however my PS is 121 in LRECL and will not mail for obvious reasons so can you please tell me a little more briefly how can I solve this issue....

Re: how to attach ps to email

PostPosted: Wed Oct 27, 2010 5:43 pm
by Robert Sample
Create two files with LRECL 121. In the first file, place all the SMTP statements (HELO, MAIL FROM, ....). In the second file, place a single line with a period in the first byte. Instead of using in-stream DD statements for your email, concatenate the three files (the first file you created with the SMTP commands, the file you want to be an attachment, then the second file you created with the period).

Re: how to attach ps to email

PostPosted: Thu Oct 28, 2010 12:20 pm
by Bad Man
Robert Thanks for your help...Hope one day I am just like you and help others...

However for the time being this is the JCL that worked...

//STEP0010 EXEC PGM=IEBGENER                         
//SYSIN    DD DUMMY                                 
//SYSUT2   DD SYSOUT=(B,SMTP)                       
//SYSOUT   DD SYSOUT=*                               
//SYSPRINT DD SYSOUT=*                               
//SYSUT1   DD  DSN=SFTW.STORAGE.CORRUPT1,DISP=SHR   
//         DD  DSN=SFTW.STORAGE.CNTL.DUMM2,DISP=SHR 
//         DD  DSN=SFTW.STORAGE.CORRUPT3,DISP=SHR   
.                                                   
/*   

CORRUPT1 AND 3 ARE DATASETS AS DIRECTED BY ROBERT AND DUMM2 HAS THE DSN THAT NEEDS TO BE ATTACHED...PERIOD IS IMPORTANT AND IS NOT THEIR JUST LIKE THAT!!

Thanks Robert again

Re: how to attach ps to email

PostPosted: Thu Oct 28, 2010 2:47 pm
by Robert Sample
Thank you for the kind words. I'm glad you got it working.

Re: how to attach ps to email

PostPosted: Fri Oct 29, 2010 12:16 am
by dick scherrer
And thank you for sharing your solution :)

d

Re: how to attach ps to email

PostPosted: Fri Apr 27, 2012 9:57 pm
by Bad Man
This worked fine till 2011 Dec and now from last 4 weeks I am getting this in the attachment. The DSN which has multiple files is how it should be on mainframes something is going wrong with the emailing part and I dont know where to start looking.


MIME-Version: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=CORRUPT_DSNS.TXT
X-NAIMIME-Modified: 1

MIME-Version: 1.0
Content-Description: Replacement for original content
X-NAIMIME-Modified: 1
Content-Type: Text/Plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit


DENIAL OF SERVICE ALERT

A denial of service protection limit was exceeded. The file has been removed.
Context: '[Message Headers]'
Reason: %REASON%
Limit: %DOSLIMIT%
Ticket Number : 08a8-4f9a-c494-0003

----------------------------------------

DENIAL OF SERVICE ALERT

A denial of service protection limit was exceeded. The file has been removed.
Context: '[Attachment Filename]'
Reason: %REASON%
Limit: %DOSLIMIT%
Ticket Number : 08a8-4f9a-c494-0003

----------------------------------------

DENIAL OF SERVICE ALERT

A denial of service protection limit was exceeded. The file has been removed.
Context: ''
Reason: %REASON%
Limit: %DOSLIMIT%
Ticket Number : 08a8-4f9a-c494-0003
See your system administrator for further information. Copyright 1999-2008 McAfee, Inc.All Rights Reserved.http://www.mcafee.com

Re: how to attach ps to email

PostPosted: Fri Apr 27, 2012 10:42 pm
by dick scherrer
Hello,

I dont know where to start looking.
I believe the diagnostic info gives a hint:
Ticket Number : 08a8-4f9a-c494-0003
See your system administrator for further information. Copyright 1999-2008 McAfee, Inc.All Rights
Have you talked with the system administrator(s)? If not, do so.

You probably have not done anything "wrong" (unless something was changed), but have been denied for some system reason (i.e. too much data, too many files, etc).