Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Multiple attachments with IEBGENER

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
picus_mf
Warnings : 1

New User


Joined: 09 Jun 2006
Posts: 51

PostPosted: Thu Jul 22, 2010 5:50 pm    Post subject: Multiple attachments with IEBGENER
Reply with quote

Hi,
I have to send e-mails with multiple attachments. It worked with with single attachment but not working for multiple. This is what I have tried

Code:

//EMAIL22  EXEC  PGM=IEBGENER                                         
//SYSPRINT DD  SYSOUT=*                                               
//SYSIN    DD  DUMMY                                                 
//SYSUT2   DD  SYSOUT=(2,SMTP)                                       
//SYSUT1   DD  *
 HELO  MASTER                 
 MAIL FROM: <IDM@ABC.com>
 RCPT TO:   <IDM@ABC.com>
DATA                         
SUBJECT: LIST OF ELEMENTS IN TEST1 - REPORT<EOM>         
MIME-VERSION: 1.0                                           
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"   
--SIMPLE BOUNDARY                                           
CONTENT-TYPE: TEXT/PLAIN                                     
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=TEST1_COBB.TXT 
//    DD  DISP=SHR,DSN=A.B.C.1  (data for first att)
 --SIMPLE BOUNDARY                                           
 CONTENT-TYPE: TEXT/PLAIN                                     
 CONTENT-DISPOSITION: ATTACHMENT; FILENAME=TEST1_COBB_2.TXT
//    DD  DISP=SHR,DSN=A.B.C.2 (data for second att)
 --SIMPLE BOUNDARY               
//    DD  DISP=SHR,DSN=A.B.C.3 (period operator on rowXcol (1x1) and nothing else)

The MAX CC is 0, but I am not getting any mails to the mentioned id.

NOTE: I have changed the e-mail ids and data set names in this post. I confirm they do not have any spelling mistakes and are valid.
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jul 22, 2010 5:57 pm    Post subject:
Reply with quote

Search the Froum for "attachment" and author as "Robert Sample" you'll get enough hits to work with.
Back to top
View user's profile Send private message
picus_mf
Warnings : 1

New User


Joined: 09 Jun 2006
Posts: 51

PostPosted: Thu Jul 22, 2010 6:02 pm    Post subject:
Reply with quote

Yes Anuj, the piece of code for multiple attachments was taken from his post. The job is completed with RC 0 but mail is not triggered.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7996
Location: Bellevue, IA

PostPosted: Thu Jul 22, 2010 6:56 pm    Post subject:
Reply with quote

If you can look at the SMTP started task, see what messages, if any, appear when you submit the job. If you cannot look at the output, you will need to get your site support group to look at the output for you.

One possibility is to add the parameter DEBUG to your SMTP configuration file and restart SMTP. This provides detailed information about what is going back and forth with SMTP. Your site support group would have to do this but it can be very beneficial in resolving issues as SMTP is not very explicit as to problems.

I do note one difference between my post and yours -- I had blank lines in certain spots. IIRC, those blank lines are not optional. You might try adding them to see if you get better results.
Back to top
View user's profile Send private message
picus_mf
Warnings : 1

New User


Joined: 09 Jun 2006
Posts: 51

PostPosted: Fri Jul 23, 2010 7:36 pm    Post subject:
Reply with quote

yes I observed the blank lines after the CONTENT-DISPOSITION and tested accordingly. But no luck.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Fri Jul 23, 2010 7:59 pm    Post subject:
Reply with quote

Just an observation:
Robert's sample also specified FROM: and TO: designators between the DATA and SUBJECT lines, which you did not do
Code:
DATA
FROM:     MAINFRAME@XXX.COM
TO:       ROBERT.SAMPLE@XXX.COM
SUBJECT:  TEST ATTACHMENT

Perhaps those statements are important to a successful operation?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7996
Location: Bellevue, IA

PostPosted: Sat Jul 24, 2010 1:00 am    Post subject:
Reply with quote

I tested with your JCL and got it running as follows:
Code:
 HELO  MASTER                 
 MAIL FROM: <IDM@ABC.com>
 RCPT TO:   <IDM@ABC.com>
DATA                         
SUBJECT: LIST OF ELEMENTS IN TEST1 - REPORT<EOM>         
MIME-VERSION: 1.0                                           
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"   
--SIMPLE BOUNDARY                                           
CONTENT-TYPE: TEXT/PLAIN                                     
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=TEST1_COBB.TXT

//    DD  DISP=SHR,DSN=A.B.C.1  (data for first att)
//    DD  *
--SIMPLE BOUNDARY                                           
CONTENT-TYPE: TEXT/PLAIN                                     
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=TEST1_COBB_2.TXT

//    DD  DISP=SHR,DSN=A.B.C.2 (data for second att)
//    DD  DISP=SHR,DSN=A.B.C.3 (period operator on rowXcol (1x1) and nothing else)
The four specific changes that were required to get it working were:
1. Added blank line after CONTENT-DISPOSITION (no, I don't know why this is required but it doesn't seem to work without the blank line)
2. Made sure all data started in column 1 -- you had --SIMPLE BOUNDARY starting in column 2, which didn't work for me
3. You were missing some // DD * lines to indicate the concatenation; otherwise, SYSIN is assumed and duplicated within the step -- not a good thing.
4. Removed final --SIMPLE BOUNDARY before the trailing period -- I thought it was needed but mine ran without it.
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 -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us