how to attach ps to email



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

how to attach ps to email

Postby shiva5977 » Tue Jul 20, 2010 11:04 am

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
shiva5977
 
Posts: 2
Joined: Sat May 01, 2010 7:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to attach ps to email

Postby Robert Sample » Tue Jul 20, 2010 5:09 pm

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.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: how to attach ps to email

Postby Bad Man » Wed Oct 27, 2010 5:22 pm

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....
Bad Man
 
Posts: 96
Joined: Sun Apr 04, 2010 2:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to attach ps to email

Postby Robert Sample » Wed Oct 27, 2010 5:43 pm

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).
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: how to attach ps to email

Postby Bad Man » Thu Oct 28, 2010 12:20 pm

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
Bad Man
 
Posts: 96
Joined: Sun Apr 04, 2010 2:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to attach ps to email

Postby Robert Sample » Thu Oct 28, 2010 2:47 pm

Thank you for the kind words. I'm glad you got it working.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: how to attach ps to email

Postby dick scherrer » Fri Oct 29, 2010 12:16 am

And thank you for sharing your solution :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: how to attach ps to email

Postby Bad Man » Fri Apr 27, 2012 9:57 pm

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
Bad Man
 
Posts: 96
Joined: Sun Apr 04, 2010 2:20 pm
Has thanked: 0 time
Been thanked: 0 time

Re: how to attach ps to email

Postby dick scherrer » Fri Apr 27, 2012 10:42 pm

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).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post