Emailing huge text file as a ZIP file



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Emailing huge text file as a ZIP file

Postby upendra_water » Thu Nov 26, 2009 2:31 pm

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.
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Emailing huge text file as a ZIP file

Postby expat » Thu Nov 26, 2009 4:53 pm

First question, what do you use to zip the file, and what do you use to unzip the file. Are they the same ?
expat
 
Posts: 459
Joined: Sat Jun 09, 2007 3:21 pm
Has thanked: 0 time
Been thanked: 8 times

Re: Emailing huge text file as a ZIP file

Postby upendra_water » Fri Nov 27, 2009 6:06 pm

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                   
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Emailing huge text file as a ZIP file

Postby dick scherrer » Sat Nov 28, 2009 11:19 am

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?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Emailing huge text file as a ZIP file

Postby upendra_water » Sat Nov 28, 2009 6:48 pm

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:
You do not have the required permissions to view the files attached to this post.
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Emailing huge text file as a ZIP file

Postby dick scherrer » Sun Nov 29, 2009 10:21 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Emailing huge text file as a ZIP file

Postby upendra_water » Mon Nov 30, 2009 3:38 pm

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.
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Emailing huge text file as a ZIP file

Postby dick scherrer » Tue Dec 01, 2009 3:19 am

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
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Emailing huge text file as a ZIP file

Postby upendra_water » Tue Dec 01, 2009 1:32 pm

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
upendra_water
 
Posts: 33
Joined: Wed Nov 25, 2009 10:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Emailing huge text file as a ZIP file

Postby dick scherrer » Wed Dec 02, 2009 4:24 am

Thank you for sharing :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post