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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to send a flat file in a zip format using SMTP
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

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 24, 2012 8:25 pm    Post subject:
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    Post subject:
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: 7908
Location: Bellevue, IA

PostPosted: Fri Aug 24, 2012 8:40 pm    Post subject:
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    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Fri Aug 24, 2012 8:52 pm    Post subject:
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: 7908
Location: Bellevue, IA

PostPosted: Fri Aug 24, 2012 8:57 pm    Post subject:
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    Post subject:
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: 7908
Location: Bellevue, IA

PostPosted: Fri Aug 24, 2012 9:15 pm    Post subject:
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: 1445
Location: Azeroth

PostPosted: Fri Aug 24, 2012 9:32 pm    Post subject:
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    Post subject:
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: 1445
Location: Azeroth

PostPosted: Fri Aug 24, 2012 9:39 pm    Post subject:
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    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