How to send mail having some content of the file via jcl
Moderators: Frank Yaeger, DikDude, Moderator Group
-
- Member
- Posts: 4
- Joined: Tue Apr 20, 2010 1:44 pm
How to send mail having some content of the file via jcl
I am using IEBGENER to send mail
//RCOUTBAL EXEC PGM=IEBGENER,TIME=&TIM
//SYSIN DD DUMMY
//SYSUT1 DD DSN=XXX.FILE,DISP=SHR
//SYSUT2 DD SYSOUT=(B,SMTP),RECFM=FB
//SYSPRINT DD SYSOUT=*
Contents of XXX.FILE:
HELO SYSA
MAIL FROM:<xxx@gmail.com>
RCPT TO:<yyy@gmail.com>
DATA
SUBJECT: XXXX
Body of the mail
I am getting mail successfully.
Now I want to send a report file that was generating a step earlier as attachment or printing the content of the report file into body of my mail.
Anyone of this will work for me.
Report file is a GDG
Please help me .I am new to mainframe
//RCOUTBAL EXEC PGM=IEBGENER,TIME=&TIM
//SYSIN DD DUMMY
//SYSUT1 DD DSN=XXX.FILE,DISP=SHR
//SYSUT2 DD SYSOUT=(B,SMTP),RECFM=FB
//SYSPRINT DD SYSOUT=*
Contents of XXX.FILE:
HELO SYSA
MAIL FROM:<xxx@gmail.com>
RCPT TO:<yyy@gmail.com>
DATA
SUBJECT: XXXX
Body of the mail
I am getting mail successfully.
Now I want to send a report file that was generating a step earlier as attachment or printing the content of the report file into body of my mail.
Anyone of this will work for me.
Report file is a GDG
Please help me .I am new to mainframe
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
-
- Member
- Posts: 4
- Joined: Tue Apr 20, 2010 1:44 pm
I am solve the problem of the attachment:
//SENDMAIL EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSUT2 DD SYSOUT=(O,SMTP) (O-Sysout class)
//SYSUT1 DD DISP=SHR,DSN=TEST1.DATA(XXXX)
// DD DISP=SHR,DSN=TEST2.DATA
TEST2.DATA is my file to be attached.
TEST1.DATA is my control card having parameters:
helo XXXXXXX
mail from:<xxxxxxxx@yyyy.com>
rcpt to:<xxxxxxxx@yyyy.com>
data
from: xxxxxxxx@yyyy.com
to: xxxxxxxx@yyyy.com
SUBJECT: TEXT FILE
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED;BOUNDARY="BOUNDARY"
--BOUNDARY
CONTENT-TYPE: TEXT/PLAIN; CHARSET=US-ASCII
CONTENT-TRANSFER-ENCODING: 7BIT
The text file attached
--BOUNDARY
CONTENT-TYPE: TEXT/PLAIN;NAME:REPORT.TXT;CHARSET=US-ASCII
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;FILENAME=REPORT.txt
But the problem is that when I tried to put those commands in ps file of LRECL 600
the mail is going.Can anyone explain why?
//SENDMAIL EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSUT2 DD SYSOUT=(O,SMTP) (O-Sysout class)
//SYSUT1 DD DISP=SHR,DSN=TEST1.DATA(XXXX)
// DD DISP=SHR,DSN=TEST2.DATA
TEST2.DATA is my file to be attached.
TEST1.DATA is my control card having parameters:
helo XXXXXXX
mail from:<xxxxxxxx@yyyy.com>
rcpt to:<xxxxxxxx@yyyy.com>
data
from: xxxxxxxx@yyyy.com
to: xxxxxxxx@yyyy.com
SUBJECT: TEXT FILE
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED;BOUNDARY="BOUNDARY"
--BOUNDARY
CONTENT-TYPE: TEXT/PLAIN; CHARSET=US-ASCII
CONTENT-TRANSFER-ENCODING: 7BIT
The text file attached
--BOUNDARY
CONTENT-TYPE: TEXT/PLAIN;NAME:REPORT.TXT;CHARSET=US-ASCII
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;FILENAME=REPORT.txt
But the problem is that when I tried to put those commands in ps file of LRECL 600
the mail is going.Can anyone explain why?
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
-
- Member
- Posts: 4
- Joined: Tue Apr 20, 2010 1:44 pm
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
Hi,
As suggested I wrote a jcl :-
//HRECALL JOB (ACCOUNT),'HRECALL',CLASS=A,
// MSGCLASS=D,REGION=32M,NOTIFY=PPPRG2
//E16LIB JCLLIB ORDER=WEPLD.PROD.PROCLIB
//***********************************************
//RCOUTBAL EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD DSN=PPPRG2.MIGRATE.MSGS05,DISP=SHR
//SYSUT2 DD SYSOUT=(B,SMTP),RECFM=F
//SYSPRINT DD SYSOUT=*
PPPRG2.MIGRATE.MSGS05 contains :-
ssssssssssssssssssssssssssssssssssssssssssssss
PPPRG2.MIGRATE.MSGS05
d ===>
***************************** Top of Data ***
HELO SYSA
MAIL FROM:<XXX@XXX.COM>
RCPT TO:<XXX@XXX.COM>
DATA
SUBJECT: JCL MAIL
BODY OF THE MAIL
**************************** Bottom of Data *
xxx stands for mail id.
I ran this job and got maxcc=0, but mail was not received.
Please advice how to send mail.
Thanks,
Aradhana
As suggested I wrote a jcl :-
//HRECALL JOB (ACCOUNT),'HRECALL',CLASS=A,
// MSGCLASS=D,REGION=32M,NOTIFY=PPPRG2
//E16LIB JCLLIB ORDER=WEPLD.PROD.PROCLIB
//***********************************************
//RCOUTBAL EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSUT1 DD DSN=PPPRG2.MIGRATE.MSGS05,DISP=SHR
//SYSUT2 DD SYSOUT=(B,SMTP),RECFM=F
//SYSPRINT DD SYSOUT=*
PPPRG2.MIGRATE.MSGS05 contains :-
ssssssssssssssssssssssssssssssssssssssssssssss
PPPRG2.MIGRATE.MSGS05
d ===>
***************************** Top of Data ***
HELO SYSA
MAIL FROM:<XXX@XXX.COM>
RCPT TO:<XXX@XXX.COM>
DATA
SUBJECT: JCL MAIL
BODY OF THE MAIL
**************************** Bottom of Data *
xxx stands for mail id.
I ran this job and got maxcc=0, but mail was not received.
Please advice how to send mail.
Thanks,
Aradhana
1) Suggest yo do NOT tailgate old topics. Stsrt a new one and reference the old one
2) Do not multi-post across forums
3) Why do you call your JOB HRECALL which was obviously the name given to a job to do and HSM task?
4) Why call your dataset ...MIGRATE... when it has nothing to do with an HSM task?
5) as I mentioned in my reply on another forum - speak to the people who know within your organisation.
2) Do not multi-post across forums
3) Why do you call your JOB HRECALL which was obviously the name given to a job to do and HSM task?
4) Why call your dataset ...MIGRATE... when it has nothing to do with an HSM task?
5) as I mentioned in my reply on another forum - speak to the people who know within your organisation.
Regards
Nic
Nic
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page