Page 2 of 2

Re: More Emailing huge text file as a ZIP file

PostPosted: Tue Apr 27, 2010 4:01 am
by dick scherrer
Hello,

Why the switch to IEBGENER?

Also, this "CONTENT-TYPE: TEXT/PLAIN;" is no longer in the post. . . :?

Also, the files to be sent are not the name of the file created in the pkzip step.

Suggest you start over and make sure everything is consistent and post all of the consistent jcl and control statements. . .

Re: More Emailing huge text file as a ZIP file

PostPosted: Tue Apr 27, 2010 4:56 am
by Robert Sample
CONTENT-TYPE can be application/zip or application/octet-stream from what I see (probably others would work, but I would try the application/zip first).

JCL to use IEBGENER to create multiple attachments (these are text attachments but there's not a lot of difference for zip files):
//MAILPROC EXEC PGM=IEBGENER
//SYSABEND DD   SYSOUT=*
//SYSTOTAL DD   SYSOUT=*
//SYSLIST  DD   SYSOUT=*
//SYSPRINT DD   SYSOUT=*
//SYSUT2   DD   SYSOUT=(9,SMTP)
//SYSIN    DD   DUMMY
//*
//SYSUT1   DD   *
HELO MAINFRAME.xxxxxx.NET
MAIL FROM: <MAINFRAME@xxx.COM>
RCPT TO: <ROBERT.SAMPLE@xxx.COM>
DATA
FROM:     MAINFRAME@xxx.COM
TO:       ROBERT.SAMPLE@xxx.COM
SUBJECT:  TEST ATTACHMENT
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED; BOUNDARY="SIMPLE BOUNDARY"
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=EMAILATT.TXT

//         DD   DISP=SHR,DSN=TTSSRS0.JCL.CNTL(EMAILATT)
//         DD   *
--SIMPLE BOUNDARY
CONTENT-TYPE: TEXT/PLAIN
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=EMAILTST.TXT

//         DD   DISP=SHR,DSN=TTSSRS0.JCL.CNTL(EMAILTST)
//         DD   *
--SIMPLE BOUNDARY--
//         DD   DISP=SHR,DSN=TTSSRS0.JCL.CNTL(EMAILAT)

Re: More Emailing huge text file as a ZIP file

PostPosted: Tue Apr 27, 2010 8:04 pm
by surya4ug
Thank you very much, Robert.

I tried application/zip and application/octet-stream as well. While the attachments were sent successfully, I'm not seeing MS excel in the 'Open with' options. PKZIP is there, but i get an 'Open archieve command failed' error while trying to open it. :( ... Aaarrghh....

the file was in CSV format before zipping. Please let me know what is needed to be done to open the file with MS excel..

Re: More Emailing huge text file as a ZIP file

PostPosted: Tue Apr 27, 2010 11:43 pm
by dick scherrer
Hello,

You most likely cannot. . . The file needs to be de-compressed first (unzipped).

Why would you expect Excel to open a compressed archive. . .?

Re: More Emailing huge text file as a ZIP file

PostPosted: Tue Apr 27, 2010 11:45 pm
by Robert Sample
If you ZIP the file and transfer it to a PC, you must UNZIP the file on the PC before you can access it via Excel.

Suggestion: create the zip file, list the members of the zip archive on the mainframe, ftp it in binary to the PC and verify that the members of the zip archive still exist on the PC zip file. That will ensure you're getting a valid zip file down -- then if it doesn't work when trying the email transfer you can experiment with the email options.

And I want to make sure you are aware that the mainframe data is in EBCDIC while the PC handles only ASCII. Since you are transferring a binary zip file, you must convert the EBCDIC to ASCII either before building the zip file on the mainframe or after unzipping on the PC.

Re: More Emailing huge text file as a ZIP file

PostPosted: Wed Apr 28, 2010 1:07 am
by surya4ug
Hello,

As i mentioned earlier, it was a bad and silly mistake

i forgot to mention the file extension as CSV while zipping the datasets... :(.....aaarghh...

Now it is working fine!!!

I have a couple of questions about formatting the mainframe CSV file further before zipping it...

a) Can we add some tags ( like we do for HTML files ) to bold / underline / highlight a set of cells?
b) the columns in the CSV file of the zipped attachment aren't entirely expanded.... In other words, i need to double click on the edge of the columns to make sure that the cell contents appear entirely. Not sure if there is a way to preformat the CSV file so that these 2 requirements are achieved....

Re: More Emailing huge text file as a ZIP file

PostPosted: Wed Apr 28, 2010 1:35 am
by dick scherrer
Hello,

Suggest you look at a .xls or .xlsx file in hex and notice the data content. . .

Not sure if there is a way to preformat the CSV file so that these 2 requirements are achieved....
No easy way that i'm aware of.