Hi,
Please help me for JCL which is used to send a e-mail with ZIP file attached. Our corrent JCL is not working for zip file attachment.
//STEP02 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,TCPSMTP)
//SYSUT1 DD DISP=SHR,
// DSN=DPFCBP2.D381057.SOURCE(ABCCNTL)
// DD DSN=TEMP01.ZIP,DISP=(OLD,PASS)
JCL to send a e-mail with zip file attached
Moderators: Frank Yaeger, DikDude, Moderator Group
Please refer following thread. If you still has any questions, please post them here.
http://www.mainframegurukul.com/ibmmain ... php?t=3508
http://www.mainframegurukul.com/ibmmain ... php?t=3508
Natarajan
Chennai
Chennai
-
- Moderator
- Posts: 1625
- Joined: Sat Aug 09, 2008 9:02 am
- Location: Mumbai, India
OK. Here is an entire email packet (except for the zipped data) which passes from the mainframe to our internal email server via SMTP:
helo SOMENODE
mail from:<johndoe@somedomain.com>
rcpt to:<johndoe@somedomain.com>
data
From:"John Doe"<johndoe@somedomain.com>
To:"John Doe"<johndoe@somedomain.com>
Subject: Test ZIP attachment from mainframe email
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"
PROLOGUE - IGNORED
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/HTML;
<HTML>
<HEAD>
<TITLE>mainframe email</TITLE>
</HEAD>
<BODY>
Test ZIP attachment from mainframe email, passing through SMTP.
<P>
</BODY>
</HTML>
--SIMPLE BOUNDARY
CONTENT-DISPOSITION: ATTACHMENT; FILENAME="somefile.zip"
<zipped data goes here>
.
The above packet is passed through SMTP using a simple IDCAMS step:
//S010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INFILE1 DD DSN=EMAIL.WITH.ZIPPED.ATTACH.MENT,DISP=SHR
//OUTFILE1 DD SYSOUT=[b](B,SMTP)[/b],
// DCB=(RECFM=VB,LRECL=01002,BLKSIZE=0,DSORG=PS)
//SYSIN DD *
REPRO IFILE(INFILE1) OFILE(OUTFILE1)
//*
If I FTP the zipped mainframe file to my workstation, I can unzip it fine. But... when the zipped file is sent through SMTP as an email attachment, any attempt to open the attachment via our internal email application causes a message box with the text:
[b]"The Compressed (zipped) Folder is invalid or corrupted."[/b]
helo SOMENODE
mail from:<johndoe@somedomain.com>
rcpt to:<johndoe@somedomain.com>
data
From:"John Doe"<johndoe@somedomain.com>
To:"John Doe"<johndoe@somedomain.com>
Subject: Test ZIP attachment from mainframe email
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"
PROLOGUE - IGNORED
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/HTML;
<HTML>
<HEAD>
<TITLE>mainframe email</TITLE>
</HEAD>
<BODY>
Test ZIP attachment from mainframe email, passing through SMTP.
<P>
</BODY>
</HTML>
--SIMPLE BOUNDARY
CONTENT-DISPOSITION: ATTACHMENT; FILENAME="somefile.zip"
<zipped data goes here>
.
The above packet is passed through SMTP using a simple IDCAMS step:
//S010 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INFILE1 DD DSN=EMAIL.WITH.ZIPPED.ATTACH.MENT,DISP=SHR
//OUTFILE1 DD SYSOUT=[b](B,SMTP)[/b],
// DCB=(RECFM=VB,LRECL=01002,BLKSIZE=0,DSORG=PS)
//SYSIN DD *
REPRO IFILE(INFILE1) OFILE(OUTFILE1)
//*
If I FTP the zipped mainframe file to my workstation, I can unzip it fine. But... when the zipped file is sent through SMTP as an email attachment, any attempt to open the attachment via our internal email application causes a message box with the text:
[b]"The Compressed (zipped) Folder is invalid or corrupted."[/b]
Agreed. But... how to send the data as 'binary'? For example, I have tried this coding in the email packet (immediately before the zipped data) ...
--SIMPLE BOUNDARY
CONTENT-TYPE: APPLICATION/ZIP; NAME="somefile.zip"
CONTENT-DISPOSITION: ATTACHMENT; FILENAME="somefile.zip"
CONTENT-TRANSFER-ENCODING: BINARY
... without success. In fact, the "BINARY" parameter gets changed to "base64" after passing through SMTP. (I can see this by doing a 'view source' within our email application.) On the other hand, if I code "BASE64" or "base64" as the ENCODING parameter, the data is truncated after passing through SMTP.
We are using mainframe PKZIP/PKUNZIP in-house. It may be that I need a certain combination of "zip" parameters, but none of the ones I've tried work.
--SIMPLE BOUNDARY
CONTENT-TYPE: APPLICATION/ZIP; NAME="somefile.zip"
CONTENT-DISPOSITION: ATTACHMENT; FILENAME="somefile.zip"
CONTENT-TRANSFER-ENCODING: BINARY
... without success. In fact, the "BINARY" parameter gets changed to "base64" after passing through SMTP. (I can see this by doing a 'view source' within our email application.) On the other hand, if I code "BASE64" or "base64" as the ENCODING parameter, the data is truncated after passing through SMTP.
We are using mainframe PKZIP/PKUNZIP in-house. It may be that I need a certain combination of "zip" parameters, but none of the ones I've tried work.
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