Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Issue in sending zip file as mail attachment using jcl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
ajithajt

New User


Joined: 21 Mar 2016
Posts: 6
Location: Kerala

PostPosted: Thu Apr 07, 2016 9:11 am    Post subject: Issue in sending zip file as mail attachment using jcl
Reply with quote

Hi,

I want to send a zip file as attachment in mail using jcl. I was able to zip the file and I tried a ftp also, it is working for me. But when I tried to do the same via email its not working. So I converted the zip file to Base64 and tried to send using the below code. I am receiving a mail with the zip attachment, but I am not able to open it since it is a corrupted file. My original zip file should have a size of 6mb, but the file I am receiving is only 260 B. I have also attached the screen shot of SYSUT2. Please advice me on how to resolve this.

Code:
 //*-----------------------------------------------------
 //*ENCODE THE ZIP FILE USING THE ENBASE64 REXX EXEC
 //*-----------------------------------------------------
 //JVSREX01 EXEC PGM=IKJEFT01,PARM='ENBASE64'
 //SYSEXEC DD DSN=TSJV.A9ZMM.SMBCR.JCLLIB,DISP=SHR
 //SYSOUT DD SYSOUT=*
 //SYSPRINT DD SYSOUT=*
 //SYSTSPRT DD SYSOUT=*
 //SYSIN DD DUMMY
 //SYSTSIN DD DUMMY
 //SYSUT1 DD DSN=STEP1.INPUT.FILE1.ZIP,DISP=SHR
 //SYSUT2 DD DSN=STEP1.INPUT.FILE1.BASE,
 // DISP=(,PASS),UNIT=SYSDA,
 // DCB=(LRECL=133,BLKSIZE=27930,RECFM=FB),
 // SPACE=(CYL,(5,0),RLSE)
 //***********************************************************
 //*SEND THE EMAIL
 //***********************************************************
 //JVSREX02 EXEC PGM=IEBGENER
 //SYSPRINT DD SYSOUT=*
 //SYSUT1 DD DSN=STEP2.EMAIL.CONTROL.LIB(emaillst1),
 // DISP=SHR
 // DD DSN= STEP1.INPUT.FILE1.BASE,DISP=(OLD,PASS)
 // DD DSN= STEP2.EMAIL.CONTROL.LIB(emaillst2),DISP=SHR
 //SYSUT2 DD SYSOUT=(B,SMTP)
 //SYSIN DD DUMMY
 //


Where STEP2.EMAIL.CONTROL.LIB(emaillst1) contains

Code:
 HELO TORGPC
 MAIL FROM:<XYZ@rediff.COM>
 RCPT TO:<XYZ@rediff.COM>
 DATA
 FROM: SMB RA - ONTARIO - JVH019
 TO: XYZ@rediff.COM
 SUBJECT: SMB RA - ONTARIO - ADHOC ORDER ACTIVITY EXTRACT
 MIME-VERSION: 1.0
 CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="---- =_NEXTPART_000_01BD3BAF.A7
 THIS MESSAGE IS IN MIME FORMAT. SINCE YOUR MAIL READER DOES NOT UNDERSTA
 THIS FORMAT, SOME OR ALL OF THIS MESSAGE MAY NOT BE LEGIBLE.
 ------ =_NEXTPART_000_01BD3BAF.A762FD80
 CONTENT-TYPE: TEXT/PLAIN; CHARSET="US-ASCII"
 CONTENT-TRANSFER-ENCODING: 7BIT
 ATTACHED IS A ZIP FILE
 ------ =_NEXTPART_000_01BD3BAF.A762FD80
 CONTENT-TYPE:APPLICATION/OCTET-STREAM; NAME=WAGNERC.ZIP
 CONTENT-TRANSFER-ENCODING: BASE64

CONTENT-DISPOSITION: ATTACHMENT; FILENAME=WAGNERC.ZIP

And STEP2.EMAIL.CONTROL.LIB(emaillst2) contains

Code:
 ------ =_NEXTPART_000_01BD3BAF.A762FD80--


In SYSUT2

[img][/img]
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Apr 07, 2016 9:42 am    Post subject: Reply to: Issue in sending zip file as mail attachment using jcl
Reply with quote

Have you sent a text file as an attachment and gotten it as an attachment to your email? If not, you need to do that first to get the syntax and spacing correct before mixing in other, more complicated file formats like ZIP or Base64. If you have gotten text file as email attachments, look at the differences between the working text attachment JCL and what you posted.

Also, is the body of the email coming across?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Thu Apr 07, 2016 3:13 pm    Post subject:
Reply with quote

Please use the code tags when presenting JCL, code, control data, data, screen shots (do not use attachments - a simple cut'n'paste is sufficient) or anything else that requires fic]xed pitch fonts and spacing.

Being new to a forum does not mean that you do not have to read the rules - just the opposite.
Back to top
View user's profile Send private message
ajithajt

New User


Joined: 21 Mar 2016
Posts: 6
Location: Kerala

PostPosted: Thu Apr 21, 2016 9:01 am    Post subject:
Reply with quote

Hi All,

Using the above listed code now I am able to send the zip file as attachment. But still am facing one more issue. Actually I am having 5 text files. In that first four are of small size. All together will have less than 1mb of size. I am able to zip and send all the first four files as attachment. The attachment which I am receiving has 51 kb. But the last file is of 27 mb and when I try to zip and send I am not receiving any mails. Zip is working fine. 27 mb data is zipped to 6mb. But I am not receiving any mails while trying to send this large file.

Please advise me on this.

Thanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Apr 21, 2016 9:23 am    Post subject:
Reply with quote

This is when you MUST talk to your site support group. SMTP as delivered in the TCP/IP configuration of z/OS has a limit of 512K for any messages, which includes attachments. This parameter can be customized by the site, but the value applies to the site not just to your emails. Your site support group can tell you what the allowed value is, and can get authorization to increase the value should your organization be able to provide adequate justification.
Back to top
View user's profile Send private message
ajithajt

New User


Joined: 21 Mar 2016
Posts: 6
Location: Kerala

PostPosted: Thu Apr 21, 2016 8:20 pm    Post subject:
Reply with quote

Hi Robert,

Thank you for the information. Is there any other alternative way for sending this big text file as zip attachment.

Thanks.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Thu Apr 21, 2016 8:53 pm    Post subject:
Reply with quote

Also give a try for PKZIP and if you could have searched more yourself then you could also see these topics topic#1 and topic#2
If PKZIP too doesn't work then follow Robert's instruction to contact site support.
Or I advise to if YOU CAN SFTP to a common location/server/drive and in the email body give the instructions for the above the location.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Apr 21, 2016 8:54 pm    Post subject:
Reply with quote

Who knows? I don't work at your site so I have no idea what software is installed there. There might be something to handle emails. If not, you could use FTP but that would NOT be an email attachment.

I said it earlier, and I'll repeat it: Contact your site support group!

Rohit: poster says zip is already being used so how does PKZIP help?
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Thu Apr 21, 2016 9:21 pm    Post subject:
Reply with quote

Thanks Robert, I take that back. icon_smile.gif
Quote:
PKZIP ensures that compressed data is secure during transmission and storage. File sizes can be reduced by up to 95% and protected with persistent security with PKZIP.
so also suggested.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us