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

How to send dataset as an e-mail attachment from mainframe


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

New User


Joined: 20 Nov 2006
Posts: 19
Location: india

PostPosted: Tue Nov 21, 2006 4:28 pm
Reply with quote

i have a requirement to send a dataset ( report files ) to users through e-mail attachments, i trierd different ways, where im getting dataset contents in mail as message, but i want to have it as attachment with user defined attachment names.

i used the following JCL, which i took it from this forum its working fine but the problem is, i want to have the datasets as attachments with user defined attachment names.


//STEP01 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//*SYSUT1 DD DISP=SHR,DSN=XXXX.JCL(HEADER)
//* DD DISP=SHR,DSN=XXXX.JCL(BODY)
//SYSUT1 DD *
HELO N01A
MAIL FROM:<ABC@YAHOO.COM>
RCPT TO:<XYZ@YAHOO.COM>
DATA
FROM:<ABC@YAHOO.COM>
TO:<XYZ@YAHOO.COM>
SUBJECT: MAIL
THIS IS A TEST MAIL SENT FROM MAINFRAME.
/*

//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Nov 21, 2006 5:47 pm
Reply with quote

You can find the answer here.

O.
Back to top
View user's profile Send private message
lal_arun_272

New User


Joined: 09 Oct 2006
Posts: 31
Location: Bangalore

PostPosted: Tue Nov 21, 2006 5:47 pm
Reply with quote

Hi

//STEP01 EXEC MAILWAY
//MAIL DD *
TO: ABC.TEST.COM
SUBJECT:TEST
// DD DSN='PS NAME'
//*

This will help you

Thanks
Arun





Thanks
Arun
Back to top
View user's profile Send private message
sri_code

New User


Joined: 20 Nov 2006
Posts: 19
Location: india

PostPosted: Tue Nov 21, 2006 6:48 pm
Reply with quote

hi ARUN,

Cant we use the same IEBGENER send email attachment.
Back to top
View user's profile Send private message
sri_code

New User


Joined: 20 Nov 2006
Posts: 19
Location: india

PostPosted: Tue Nov 21, 2006 7:05 pm
Reply with quote

I HAVE USED FOLLOWING CODE.
But the problem is im getting mail with attachment but the attachment does not contain records in dataset (i.e., DSN=data.set.name), it is empty.

---------------------------------------------------------------------------
//STEP01 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUT1 DD *

HELO N01A
MAIL FROM:<ABC@YAHOO.COM>
RCPT TO:<XYZ@YAHOO.COM>
DATA
FROM:<ABC@YAHOO.COM>
TO:<XYZ@YAHOO.COM>
SUBJECT: MAIL
THIS IS A TEST MAIL SENT FROM MAINFRAME

MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="BOUNDRY1"
--BOUNDRY1
CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"
CONTENT-TRANSFER-ENCODING: 7BIT

Hallo
This is your Notepad file
--BOUNDRY1
CONTENT-TYPE: APPLICATION/OCTET-STREAM;
CONTENT-DISPOSITION:ATTACHMENT;FILENAME="WHATEVER.TXT"

// DD DISP=SHR,DSN=data.set.name
//
Back to top
View user's profile Send private message
abhishek.pradhan

New User


Joined: 22 Nov 2006
Posts: 2
Location: bangalore

PostPosted: Fri Nov 24, 2006 12:42 pm
Reply with quote

Hi,

We can use XMIT to do this task, but i dont have the correct JCL for XMIT job. Can anybody help?

-Abhi
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 Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top