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

Email a file from mainframes as attachment


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Thu Jun 25, 2009 2:08 pm
Reply with quote

Hi friends,
I use below step to email the user with the error report in the body of the email.
Code:

//STEP100  EXEC PGM=IEBGENER                                       
//*                                                                 
//*  SEND E-MAIL MESSAGE WITH THE ERROR REPORT                     
//*                                                                 
//SYSIN    DD  DUMMY                                               
//SYSUT1   DD  DSN=TEST.EMAIL.ADDRESS,DISP=SHR                     
//         DD  DSN=TEST.EMAIL.CONTENT,DISP=SHR                     
//*OUTPUT                                                           
//SYSUT2   DD  SYSOUT=(B,STPRSMTP)                                 


TEST.EMAIL.CONTENT is the error report.

Details of TEST.EMAIL.ADDRESS:
Code:

HELO ONCGHP4.TESTING.COM               
MAIL FROM:<MAINFRAME@ONCGHP4>           
RCPT TO:<TEST.EMAIL@US.TESTING.COM>     
DATA                                     
DATE:                                   
SUBJECT: EXCEPTION REPORT FOR TESTING   
                                         


But I want to send the email with the reprot as an attachment.
What changes should I make to do so?

Thanks,
Balu
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jun 25, 2009 3:07 pm
Reply with quote

Hi,

see this ibmmainframes.com/viewtopic.php?t=31751&highlight=sample+text


Gerry
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Thu Jun 25, 2009 4:17 pm
Reply with quote

Thanks for the link !!
I have tested that
But I am still receiving the email with file in the body of the mail but not as an attachment.
More over all these statements also in the email itself.
MIME-VERSION, CONTENT-TYPE TEXT/P, CONTENT-DISPOSITION, etc

Code:
//SYSIN    DD  DUMMY                                     
//SYSUT1   DD  DSN=TEST.TRN.MAILSEND,DISP=SHR       
//         DD  DSN=TEST.TRN.REPORT,DISP=SHR       
//         DD  DSN=TEST.TRN.PERIOD,DISP=SHR         
//*OUTPUT                                                 
//SYSUT2   DD  SYSOUT=(B,STPRSMTP)                       
//SYSPRINT DD  SYSOUT=*                                   


Content:TEST.TRN.MAILSEND
Code:

HELO ONCGHP4.TESTING.COM               
MAIL FROM:<MAINFRAME@ONCGHP4>           
RCPT TO:<TEST.EMAIL@US.TESTING.COM>                 
DATA                                                         
DATE:                                                         
SUBJECT: ERROR LOADING FUND TABLE                             
                                                             
   !!!PELASE FIND THE ATTACHED ERROR REPORT!!!!               
                                                             
MIME-VERSION: 1.0                                             
CONTENT-TYPE: TEXT/PLAIN                                     
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=ERRORFILE.TXT       

TEST.TRN.REPORT is my report.
What should be there in TEST.TRN.PERIOD?
I have put one '.'
Is that fine?
Please let me know if any error in the above steps.
Thanks,
Balu
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Jun 25, 2009 5:11 pm
Reply with quote

SMTP requires an email end with a period on a line by itself. That is what is supposed to be in TEST.TRN.PERIOD. If it's not showing up as you want, you may need to review (and possibly get a trace from) the STPRSMTP address space output. Depending upon your site, this may require site support group help.
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Thu Jun 25, 2009 5:23 pm
Reply with quote

Thanks for the quick reply
But, I am sorry.I haven't got what you said!

Quote:
SMTP requires an email end with a period on a line by itself.

Will system automatically put a dot in to that dataset?

Quote:
If it's not showing up as you want

There is no attachment, every thing is in body itself.
What changes might help to get the report in attachment.

Thanks,
Balu[/code]
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Jun 25, 2009 5:29 pm
Reply with quote

Quote:
Will system automatically put a dot in to that dataset?
No, that's why you have to put one there. If it is not present, SMTP flat out refuses to send the email.

If you're not getting the attachment, you need to work with your site support group to trace the SMTP process and see what's going on from mainframe to mail server to mail client.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SH256/MD5 Checksum in Mainframes JCL JCL & VSAM 14
Search our Forums:

Back to Top