More Emailing huge text file as a ZIP file



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

Re: More Emailing huge text file as a ZIP file

Postby dick scherrer » Tue Apr 27, 2010 4:01 am

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. . .
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: More Emailing huge text file as a ZIP file

Postby Robert Sample » Tue Apr 27, 2010 4:56 am

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)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: More Emailing huge text file as a ZIP file

Postby surya4ug » Tue Apr 27, 2010 8:04 pm

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..
surya4ug
 
Posts: 11
Joined: Mon Mar 29, 2010 3:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: More Emailing huge text file as a ZIP file

Postby dick scherrer » Tue Apr 27, 2010 11:43 pm

Hello,

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

Why would you expect Excel to open a compressed archive. . .?
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: More Emailing huge text file as a ZIP file

Postby Robert Sample » Tue Apr 27, 2010 11:45 pm

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.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: More Emailing huge text file as a ZIP file

Postby surya4ug » Wed Apr 28, 2010 1:07 am

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....
surya4ug
 
Posts: 11
Joined: Mon Mar 29, 2010 3:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: More Emailing huge text file as a ZIP file

Postby dick scherrer » Wed Apr 28, 2010 1:35 am

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.
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

Previous

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post