How to zip the file and email that as an attachment in JCL
Posted: Sat Aug 04, 2012 1:35 pm
Hi All,
Requesting your advice and help on the below issue.
Am having issue while sending the zip file as an attachment throught JCL.
I can zip the file using PKZIP (usually we use to FTP the zip file but now we got different request to mail those). Even i can mail the attachment. But am getting error while trying to open the zip file, copied to my desktop.
Error is : ' Invalid or unknown archive format '
I guess this is the issue while mailing the file. Below is the code am using to mai
ZIP Command we are using for PKZIP
SYSPRINT for zip
For mailing
xxxxx.xxxxx.xxx.ATTACH1 contains the below one
Can anyone help me here please????
Requesting your advice and help on the below issue.
Am having issue while sending the zip file as an attachment throught JCL.
I can zip the file using PKZIP (usually we use to FTP the zip file but now we got different request to mail those). Even i can mail the attachment. But am getting error while trying to open the zip file, copied to my desktop.
Error is : ' Invalid or unknown archive format '
I guess this is the issue while mailing the file. Below is the code am using to mai
ZIP Command we are using for PKZIP
Code: Select all
-TEXT
-INDD(INPUT1)
-ARCHOUTDD(OUTARCH1)
-NIA(xxxxx.xxxxx.xxxx.xxx.xx,RPT.TXT)
-FILE_TERMINATOR()
SYSPRINT for zip
Code: Select all
ZPDA000I HFS_ORG=-------
-TEXT
-DATA_TYPE(TEXT)
-INDD(INPUT1)
-ARCHOUTDD(OUTARCH1)
-NIA(xxxxx.xxxxx.xxxx.xxx.xx,RPT.TXT)
-FILE_TERMINATOR()
ZPAM030I OUTPUT Archive opened: xxxx.xxxx.xxxx05W.xxxxPT.BKP0803
ZPAM253I ADDED File xxxxx.xxxxx.xxxx.xxx.xx
ZPAM254I as RPT.TXT
ZPAM255I (DEFLATED 84%/84%) DATA SIZE 1,672,874; ZIP SIZE 274,334
ZPAM140I FILES: ADDED EXCLUDED BYPASSED IN ERROR COPIED
ZPAM140I 1 0 0 0 0
ZPMT002I PKZIP processing complete. RC=00000000 0(Dec)
Code: Select all
//STEP01 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=D
//SYSUT2 DD SYSOUT=(B,SMTP)
//* WEEKLY ACTIVITY REPORT
//SYSUT1 DD DSN=xxxxx.xxxxx.xxx.ATTACH1,DISP=SHR
// DD DSN=xxxx.xxxx.xxxx05W.xxxxPT.BKP0803,DISP=SHR
Code: Select all
HELO SOUTH2
MAIL FROM:<XXXXX@XX.COM>
RCPT TO:<XXXXXX@XX.COM>
DATA
FROM: Bharani
TO: "xxxxxx"
SUBJECT: xxxxxxxxx
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED;BOUNDARY="MIME"
--MIME
CONTENT-TYPE: TEXT/PLAIN; CHARSET=US-ASCII
CONTENT-TRANSFER-ENCODING: 7BIT
Hi,
See the attached.
Thanks
--MIME
CONTENT-TYPE: TEXT/PLAIN;NAME=report.ZIP
CONTENT-TRANSFER-ENCODING: 7BIT
CONTENT-DISPOSITION: ATTACHMENT;
FILENAME=xxxx.xxxx.xxxx05W.xxxxPT.BKP0803;