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

How to send a flat file in a zip format using SMTP


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

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Fri Aug 24, 2012 8:22 pm
Reply with quote

Hi All,

I know this could be a very basic requirement but I was not able to achieve the same so I need your help/comments

I have a huge flat file which in file size is near to 15MB, this file needs to be sent as an report to a mail group using SFTP. The attachment is of .csv type.

Since it is of around 15 MB size, the mail server is restricting to send this mail to the receptents. Though it may be a lame way, I tried to to give .zip instead of .csv in the SMTP step, the job ended with RC=0 but still I haven't received the mail.

Please suggest me if you have any better options
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: Fri Aug 24, 2012 8:25 pm
Reply with quote

Hello,

For anyone to be able to help, you need to post the jcl and control statements used as well as the JES sysouts from the run.

As files go 15meg is not very large, but many e-mail systems will not permit files of this size to be sent as attachments.

Suggest you consider not use e-mail and just transfer the file using SFTP.
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Fri Aug 24, 2012 8:32 pm
Reply with quote

Hi Dick,

Firstly, my apologies for not posting the JCL or the JES messages, below is the SMTP step that I am using. Secondly, I agree with your option of sending it to a location on a server via SFTP instead of mailing but thats still under consideration by our client partners but wanted to see if I could acheive this using SMTP and zip that file.

here is the JCL statement
Code:
//******************************************************************* 
//*  EMAIL XXXX REPORT                                       
//*********************************************************************
//SAS1    EXEC SMTPMAIL,PARM='%SMTPREXX A1     DSN="XXX.YY.ZZZZ.RRRR.
//             REPT"   NAME="XXX_REPORT" EXT="ZIP";',           
//           COND=(0,LT)                                               
//SMTPOUT  DD  SYSOUT=(B,SMTP),                                       
//             DCB=(RECFM=FB,LRECL=1023)                               
//SMTP     DD *
HELO NJED                                         
MAIL FROM:<firstname.lastname@companyname.COM>     
RCPT TO:<firstname.lastname@companyname.COM>     
DATA                                             
FROM: firstname.lastname@companyname.COM
TO: firstname.lastname@companyname.COM
           
SUBJECT: *** REPORT TEST *** 
                                                 
REPORT.                       
.                                                 
         
/*
//
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 24, 2012 8:40 pm
Reply with quote

Which ZIP product are you using on the mainframe? If the answer is "none", then your first problem is that merely indicating to SMTP that you are sending a ZIP file does not, in any way, reduce the size of nor change your source file.

If you are using a ZIP product and generating a ZIP file from your source file, you can search this forum for "SMTP" and "ZIP" and find some topics dealing with using MIME to send ZIP files through SMTP. Getting the precise data format correct can take a few iterations, but MIME handles ZIP files just fine. Whether or not the zipped file is small enough to pass your SMTP filter is another question.
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Fri Aug 24, 2012 8:44 pm
Reply with quote

Hi Robert,

We are currently not using any zip product and that as mentioned by you could be the primary take of no mail being generated.

As I am not sure if there are any zip products available in our shop, could you suggest the most common zip products on mainframes so that I can check with my systens manager to obtain a license for that product.

Thanks a many for clarifications.

Regards,
Ravi
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Aug 24, 2012 8:52 pm
Reply with quote

ravindra.vadali wrote:
As I am not sure if there are any zip products available in our shop, could you suggest the most common zip products on mainframes so that I can check with my systens manager to obtain a license for that product.

I would certainly approach both PKWARE and Data 21.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 24, 2012 8:57 pm
Reply with quote

PKZIP has a product called PKZIP/MVS last I heard (several years back).
My site uses DATA 21'S ZIP-390.
There are other ZIP products for z/OS but those are the two I've tried myself at one point or another. ZIP products for the mainframe will typically run several thousand (and up) dollars, depending upon your machine size.

Unix System Services supports PAX and TAR, both of which can compress files similar to ZIP. Many PC ZIP products can recognize tar files and treat them as if they were a ZIP file. There's also GZIP and GUNZIP available to install on the mainframe (at least the last time I looked) and being GNU licensed, they are free.

And when you get something zipped, remember that you cannot treat that file as text in MIME (or FTP or whatever) since it is a binary file.
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Fri Aug 24, 2012 9:12 pm
Reply with quote

Thanks All, I will suggest these products and check my fate. Once again I am very grateful to all of you for your valuable suggestions.

In the mean time I will try my way through FTP.

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 24, 2012 9:15 pm
Reply with quote

PKZIP and ZIP-390 have options to convert EBCDIC to ASCII while zipping the file. If you use Unix System Services, iconv can convert an EBCDIC file to ASCII before using tar (or pax) against it. If this conversion is not done, the data on the receiving system will still be in EBCDIC and *nix machines (and PCs and Macs) don't do well with EBCDIC data.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Aug 24, 2012 9:32 pm
Reply with quote

Hello,
Since your step name has "SAS", by any chance do you generate the attachment CSV using SAS?

If yes, then you can change the CSV output destination filename to a Unix directory with ASCII conversion(TRANTAB=ASCII option or something similar)

Then perform a TAR compression of the file.

SAS can send the TAR compressed file as email directly from USS.

Hope it helps.
Back to top
View user's profile Send private message
ravindra.vadali

New User


Joined: 30 Jan 2012
Posts: 34
Location: USA

PostPosted: Fri Aug 24, 2012 9:34 pm
Reply with quote

Hi Vasanth,

Actually my stepname is SAS but the actual utility that I am using is an SMTP. Sorry for any confusion caused because of the step name.

Thanks,
Ravi
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Aug 24, 2012 9:39 pm
Reply with quote

No problem :-) Good you don't have SAS, it makes people lazy & forget COBOL.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Populate last day of the Month in MMD... SYNCSORT 2
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top