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

JCL to send a mail with an attachament(dataset as report)


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

New User


Joined: 04 Dec 2006
Posts: 44
Location: Pune,India

PostPosted: Mon Aug 04, 2008 5:45 pm
Reply with quote

Hi all,

I have to create a job which will send a mail with an attachment. The attachment will be a dataset A.B.C.

Please help.

Thanks
Prasanth
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Aug 04, 2008 5:52 pm
Reply with quote

This previous topic might be a good starting point.

Also see the MVS Mail page.
Back to top
View user's profile Send private message
jsathishbabu84

New User


Joined: 07 Jun 2007
Posts: 22
Location: India

PostPosted: Tue Aug 05, 2008 11:06 am
Reply with quote

Hi,

You can also use XMIT for sending attachments in different formats(.HTML, .TXT etc.)

Regards,
SJ
Back to top
View user's profile Send private message
prasanth_urs

New User


Joined: 04 Dec 2006
Posts: 44
Location: Pune,India

PostPosted: Tue Aug 05, 2008 11:18 am
Reply with quote

Hi jsathishbabu84,

please give the jcl in detail using XMIT....

Many thanks in advance.

Prasanth
Back to top
View user's profile Send private message
mshivashankar007

New User


Joined: 03 Aug 2007
Posts: 2
Location: hyderabad

PostPosted: Tue Aug 05, 2008 3:01 pm
Reply with quote

use this job card and try once ,,,,if u know SAS utility
//STEP0300 EXEC SAS,
// REGION=4104K,
// OPTIONS='ERRORS=0,EMAILSYS=SMTP,EMAILHOST=SMTP.AICI.COM'
//WORK DD SPACE=(CYL,(30,50),,,ROUND)
//FT12F001 DD COPIES=1
//SYSIN DD *

DATA REPORT;
FORMAT DATE1 MMDDYY8.;
CALL SYMPUT ('HDATE',PUT(TODAY(),MMDDYY8.));
FORMAT EMAILDATE MMDDYY8.;
PUT "!EM_SUBJECT!" "HDATE11";
FILENAME MYFILE EMAIL
FROM= (......mail id's )
TO= (..mail id's..)
")
ATTACH=("file attach here" )
TYPE= "TEXT/PLAIN";
DATA REPORT;
SET REPORT;
FILE MYFILE;
PUT "!EM_SUBJECT!" "OVER AGE REPORT FOR APPLIED INDUSTRIAL - &HDATE";
PUT " ";
PUT " ";
PUT "THIS EMAIL CONTAINS AN OVER AGE REPORT FOR AIT .";
MONTHS.";
PUT " ";
RUN;
QUIT;
*
Back to top
View user's profile Send private message
jsathishbabu84

New User


Joined: 07 Jun 2007
Posts: 22
Location: India

PostPosted: Tue Aug 05, 2008 3:43 pm
Reply with quote

Prasanth,

Find the sample JCL below,

//MAIL EXEC PGM=IKJEFT1B,DYNAMNBR=50
//SYSEXEC DD DISP=SHR,DSN=SYSU.XMITIP.EXEC
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//XYZ DD DSN=(Dataset name to be attached as file),DISP=SHR
//SYSTSIN DD *
%XMITIP(email id) -
SUBJECT 'Subject of mail' -
FORMAT TXT - (indicates as text file attachment) -
MSGDS 'Dataset name which has message for body of mail' -
FILEDD (XYZ) - (DD Name of the DSN given in JCL)
FILENAME (ABC.TXT) - (Filename to be mentioned in the mail)
FROM email id
/*

Regards,
SJ
Back to top
View user's profile Send private message
prasanth_urs

New User


Joined: 04 Dec 2006
Posts: 44
Location: Pune,India

PostPosted: Wed Aug 13, 2008 11:25 am
Reply with quote

Hi SJ,

Thank you for the jcl...
but could you please tell me, the use of SYSU.XMITIP.EXEC.
This differs from job to job.
so please tell me how to find out the SYSEXEC.

Please help this is urgent..

Thanks
Prasanth.
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: Wed Aug 13, 2008 9:22 pm
Reply with quote

Hello,

If it is urgent, you would probably get faster answers from your local support people. . .

These people can also tell you if xmitip has been installed on your system and the names of any required datasets.

Because installation is optional (many places do not have xmitip installed) and it is completely configured locally, someone on your system will need to tell you what the datasets are named.

SYSU.XMITIP.EXEC is the dataset that contains the rexx code for xmitip - on that system. It would almost surely be a different dsn on your system.
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 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
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top