Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Email a file from mainframes as attachment

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Email a file from mainframes as attachment
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: 1703
Location: Australia

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

Hi,

see this http://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    Post subject:
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: 8213
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 25, 2009 5:11 pm    Post subject:
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    Post subject:
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: 8213
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 25, 2009 5:29 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us