Page 1 of 2

Emailing huge text file as a ZIP file

PostPosted: Thu Nov 26, 2009 2:31 pm
by upendra_water
I have a JCL that sends a text file as an attachment in an email. However the size of this file is huge and I am able to email only 2MB of data. Remaining rows are getting deleted by SMTP.
I tried using zip but I was unable to unzip the attachment.
While unzipping it gives following error: "Cannot open file: it does not appear to be a valid archive"
Can anyone provide right JCL syntax to zip this file before attaching? So that users can unzip this file without headache.
Your help in this regard is highly appreciated.

Re: Emailing huge text file as a ZIP file

PostPosted: Thu Nov 26, 2009 4:53 pm
by expat
First question, what do you use to zip the file, and what do you use to unzip the file. Are they the same ?

Re: Emailing huge text file as a ZIP file

PostPosted: Fri Nov 27, 2009 6:06 pm
by upendra_water
I am using below mentioned syntax for zip and then use winzip@Pro 11.1 to unzip the file.
When I receive an email it shows zip file as attachment but when I try to unzip it throws following error:
"Cannot open file: it does not appear to be a valid archive"

HELO node
MAIL FROM: a1@yahoo.com
RCPT TO: b@google.com
DATA
TO: b@google.com
SUBJECT: Test mail
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="---- =_NEXTPART_000_01BD3BAF.A762FD80"
------ =_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="A.ZIP"
CONTENT-TRANSFER-ENCODING: BASE64                   

Re: Emailing huge text file as a ZIP file

PostPosted: Sat Nov 28, 2009 11:19 am
by dick scherrer
Hello,

Unless i am missing something, that is the e-mail control . . . There is no compression/zip specified.

I've not seen 7bit ascii for some time - is this correct?

Back to the original question - how was the file zipped?

Re: Emailing huge text file as a ZIP file

PostPosted: Sat Nov 28, 2009 6:48 pm
by upendra_water
I am not sure how I got email with zip attachment.
I simply picked the above code from internet and tried it.
But now when I referred a manual on SMTP I got a proper JCL syntax which can zip a .txt file and send as an email attachment.
I have copied this syntax Below .
When I used this syntax I am still getting an error and have attached a screen shot depicting this error.
Do you have any idea why this is happening?

%XMITIP (upendra_water@gmail.com) -
 MSGDD EMAILMSG -                           
 FILE ('XJNDSP.DAILY.REPORT.NOV27') -
 FILENAME (REPORT1.ZIP) -                   
 FORMAT (ZIP/DCV.txt) -                     
 SUBJECT 'Daily_chrg_volume for &DATE ' -   
 FROM upendra_water@gmail.com -     
 IMPORTANCE HI -                           
 ZIPMETHOD NORMAL -                         
 ZIPPASS nov123


Error Screen shot:

Re: Emailing huge text file as a ZIP file

PostPosted: Sun Nov 29, 2009 10:21 am
by dick scherrer
Hello,

Please do not post "screenshots" - they are less readable and introduce considerable clutter. To post the content of a maniframe screen, simply use copy/paste and the "Code" tag. There is a Preview function so you can see your post as it will appear to the forum. When you have the post looking as you wish, Submit.

Suggest you talk with whoever supports xmitip on your system as there are system-specific things you need to deal with.

The approach of just trying things willy-nilly with no thought as to why they are being tried usually causes this kind of problems. Someone with the correct perspective of how things are configured on your system will be the best help.

Re: Emailing huge text file as a ZIP file

PostPosted: Mon Nov 30, 2009 3:38 pm
by upendra_water
Hello guys. Thanks a lot for your quick response.
The zipping option finally worked!!
We just had to specify following statement after job statement
/*ROUTE XEQ PKZIP
and proper SYSEXEC and STEPLIB statements.

Re: Emailing huge text file as a ZIP file

PostPosted: Tue Dec 01, 2009 3:19 am
by dick scherrer
Good to hear it is working - thanks for letting us know :)

If you post the complete submitted job, it will probably help someone else later ;)

d

Re: Emailing huge text file as a ZIP file

PostPosted: Tue Dec 01, 2009 1:32 pm
by upendra_water
Yes sure, as many people face this issue, it would be certainly helpful.
Below is the job.
There are lot of other things that you can do with XMITIP. Like sending only specific pages of your report or sending report based on KEYVAL etc.
You can master XMITIP just by following instructions in the manual.
This is really good, sweet and short manual on XMITIP,mentioned below is the link and the code.
Hope this helps :D

http://www.lbdsoftware.com/XMITIP-Guide.pdf

//MYJOB001 JOB (@),'ZIP',
// MSGCLASS=X,CLASS=0,TIME=2,NOTIFY=&SYSUID
/*ROUTE XEQ PKZIP
//PSTP070  EXEC PGM=IKJEFT1B,
//         DYNAMNBR=25       
//*                         
//SYSEXEC  DD DSN=(Please check your shop standards for this)
//STEPLIB  DD DSN=(Please provide proper loadlib here)
//SYSTERM  DD  DUMMY
//MSGFILE  DD DSN=XJNDSP.MAIL.BODY.NOV27,DISP=SHR
//ATTACHM  DD DSN=XJNDSP.DAILY.REPORT.NOV27,DISP=SHR
//SYSTSIN  DD DSN=XJNDSP.PROD.DATALIB(NEWMEM),DISP=SHR
//*
//SYSTSPRT DD  SYSOUT=*
//SYSDBOUT DD  SYSOUT=*
//SYSUDUMP DD  SYSOUT=*
//SYSPRINT DD  SYSOUT=*
//*

Contents of SYSTSIN datalib are as follows:
%XMITIP ("Firstname1 Lastname1" <Firstname1_Lastname1@abc.com>, -
   "Firstname2 Lastname2" <Firstname2_Lastname2@abc.com>) - (**** This is TO list)
   MSGDD MSGFILE -  (**** This file contains body of your mail)
   FILEDD ATTACHM -
   FILENAME (DCV.ZIP) -
   CC ("Firstname3 Lastname3" <Firstname3_Lastname3@abc.com>, -
       "Firstname4 Lastname4" <Firstname4_Lastname4@abc.com>) -
   FORMAT (ZIP/DCV.TXT) -
   SUBJECT 'Daily Charge Volume for &DATE' -                   
   FROM "Firstname5 Lastname5" <Firstname5_Lastname5@abc.com> -
   ZIPMETHOD NORMAL -
   ZIPPASS dcv123

Re: Emailing huge text file as a ZIP file

PostPosted: Wed Dec 02, 2009 4:24 am
by dick scherrer
Thank you for sharing :)

d