IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

email an attachment through JCL


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun Jun 14, 2009 2:13 am
Reply with quote

Hello,

In addition to what Robert mentioned, it may be that the mail was sent, but was denied some way (treated as junk, deleted, rejected, etc) by the receiving e-mail system.
Quote:
You really, really, really must get site support people involved
Yup, you really really should. . .
Back to top
View user's profile Send private message
Nair47

New User


Joined: 13 Jun 2009
Posts: 2
Location: vizag

PostPosted: Mon Jun 15, 2009 6:00 pm
Reply with quote

hi,
thank u so much....one of my freind had written the same code....but this worked for him.....and i recieved mail sent by him through main frame....every thing was fine...but the thing is he has sent me using vsam file......but this didnot work for me when i tried for it directly....the main frame server name and mails every thing supports the mainframe mails....
Back to top
View user's profile Send private message
Srinivas46

New User


Joined: 03 Oct 2009
Posts: 4
Location: Chennai

PostPosted: Sat Feb 27, 2010 8:33 am
Reply with quote

Hi,

I was able to use the code to send an email with attachement as a Text file. Now, my requirement is as follows:
I have a huge MS word document (around 20 MB) which was compressed using ZIP and then FTP'ed to a mainframe dataset in Binary format.
I want an email to be sent with the MS Word doc (or the ZIP file) as an attachment. Can this be done thru JCL ?

Please let me know if it can be done thru any other means.

Thanks,
Srinivas

Robert Sample wrote:
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: <RSAMPLE@********>
DATA
FROM:     MAINFRAME@********
TO:       ROBERT SAMPLE
SUBJECT:  TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=FILE.TXT
//       DD DSN=TTSSRS0.JCL.CNTL(EMAILATT),DISP=SHR
//       DD DSN=TTSSRS0.JCL.CNTL(EMAILAT),DISP=OLD
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Feb 27, 2010 9:06 am
Reply with quote

Hello,

Is XMITIP available on your system?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Feb 27, 2010 5:33 pm
Reply with quote

Quote:
I have a huge MS word document (around 20 MB) which was compressed using ZIP and then FTP'ed to a mainframe dataset in Binary format.
I want an email to be sent with the MS Word doc (or the ZIP file) as an attachment. Can this be done thru JCL ?
No -- JCL does nothing but execute programs. If you wanted to use a utility like IEBGENER to do this, that would work. But since JCL does nothing by itself, you cannot do anything "thru JCL".

Even if you use a utility such as IEBGENER, you have to consult with your site support group. They have established a limit on the size of the SMTP email (the default is 512K), and unless that limit is larger than the size of the document you are attempting to email, it cannot be sent via SMTP.
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Thu Aug 26, 2010 4:42 pm
Reply with quote

Hi,
I have tried searching through out the forum and got so far and just hung up at last step, Thanks in advace for your help:

I have to do some checks on ESP which get into a DS of LRECL of 133 and then has to send it as an attachment ( rqrmts are pretty same)

If I do it with SYSUT DD * as below
Code:


//JS015   EXEC PGM=IEBGENER,                                           
//             COND=(0,LT)                                             
//SYSUT1    DD *                                                       
  HELO CS01                                                             
  MAIL FROM:<SAURABH.XXXXXX@XXXXX.COM>                               
  RCPT TO:<SAURABH.XXXXXX@XXXXX.COM>                                 
  DATA                                                                 
  FROM: SAURABH.XXXXXX@XXXXX.COM                                     
  TO:  SAURABH.XXXXXX@XXXXX.COM                                       
  SUBJECT: CS01 ESP JOBS THAT HAVE FAILED OR ARE IN PREDWAIT STATE.     
  MIME-VERSION: 1.0                                                     
  CONTENT-TYPE: TEXT/PLAIN                                             
  CONTENT-DISPOSITION: ATTACHMENT; FILENAME=IDWJOBS.TXT                 
  ===================================================                   
  FOLLOWING ARE CS01 ESP JOBS THAT HAVE FAILED OR ARE IN PREDWAIT STATE.
  (CREATED BY PRNDXXXX)                                                 
//      DD DSN=XXXXXX.PRND.PRNDDES3.ESPRPT4,DISP=SHR               
//          DD DSN=OFFSAC.CTLLIB.EXIT,DISP=SHR                         
//SYSUT2    DD SYSOUT=B,DEST=(CS01,SMTP),                               
//          DCB=(RECFM=FB,LRECL=133)                                   


Spool says " DATA SET UTILITY - GENERATE
IEB311I CONFLICTING DCB PARAMETERS " and MAXCC 12

I get an MAXCC 12 and If I put the same with in a DS of 133 LRECL , I t gives MAX CC 0 gives the result in spool but no email.

BLKSIZE of all the three DS are same as below.

Code:

//JS015   EXEC PGM=IEBGENER,                                       
//             COND=(0,LT)                                         
//SYSUT1    DD DSN=XXXXXX.CTLLIB.TOOL,DISP=SHR                     
//          DD DSN=XXXXXX.PRND.PRNDDES3.ESPRPT3,DISP=SHR           
//          DD DSN=XXXXXX.CTLLIB.EXIT,DISP=SHR                     
//SYSUT2    DD SYSOUT=B,DEST=(CS01,SMTP),                           
//          DCB=(RECFM=FB,LRECL=133)                               
//SYSIN     DD DUMMY                                               
//SYSPRINT  DD SYSOUT=*                                             
//*****************************************************************


Let me know if anything else is needed.
I have searched thruout the forum.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 26, 2010 5:20 pm
Reply with quote

This needs to be put into a file with LRECL 133 and not kept instream:
Code:
  HELO CS01                                                             
  MAIL FROM:<SAURABH.XXXXXX@XXXXX.COM>                               
  RCPT TO:<SAURABH.XXXXXX@XXXXX.COM>                                 
  DATA                                                                 
  FROM: SAURABH.XXXXXX@XXXXX.COM                                     
  TO:  SAURABH.XXXXXX@XXXXX.COM                                       
  SUBJECT: CS01 ESP JOBS THAT HAVE FAILED OR ARE IN PREDWAIT STATE.     
  MIME-VERSION: 1.0                                                     
  CONTENT-TYPE: TEXT/PLAIN                                             
  CONTENT-DISPOSITION: ATTACHMENT; FILENAME=IDWJOBS.TXT                 
  ===================================================                   
  FOLLOWING ARE CS01 ESP JOBS THAT HAVE FAILED OR ARE IN PREDWAIT STATE.
  (CREATED BY PRNDXXXX)                                                 
Back to top
View user's profile Send private message
Saurabh Pune

New User


Joined: 26 May 2009
Posts: 23
Location: USA

PostPosted: Thu Aug 26, 2010 7:41 pm
Reply with quote

When I keep the code Instream the job goes good with MAX CC 0 but no email id being received while I received the mail when the lrecl was 80 ???
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Aug 26, 2010 7:50 pm
Reply with quote

You would be best off contacting your site support group, who can look at your actual job output to determine what happened. They can also turn on debugging in the SMTP started task and look at more details about what SMTP gets for your job.

Without actual job output to look at, we cannot do much.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 26, 2010 8:27 pm
Reply with quote

Hello,

Quote:
I won't be able to contact somebody else....
Why not?

Schwab has quite a few excellent technical people. . .
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 26, 2010 8:38 pm
Reply with quote

Quote:
Schwab has quite a few excellent technical people. . .


very true, but I doubt that is the problem.

probably, the TS's firm, has very few, and don't want the client to know that fact.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 26, 2010 11:20 pm
Reply with quote

Quote:
probably, the TS's firm, has very few, and don't want the client to know that fact.
And the post i quoted has magically disappeared. . .

icon_confused.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts mail attachment with excel format All Other Mainframe Topics 2
No new posts REXX to send an email in Mainframe wi... CLIST & REXX 3
No new posts REXX to send an email in Mainframe CLIST & REXX 4
No new posts Problem while sending special charact... JCL & VSAM 4
No new posts TXT2PDF and then SMTP email a PDF JCL & VSAM 4
Search our Forums:

Back to Top