IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sending ZIP File in Mail.


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Wed Dec 15, 2010 1:22 pm
Reply with quote

Hi,

I'm trying to ZIP an excel file and send it in mail. I tried SAS and IEBGENER. But am not able to get the zip file as attachment. Here's the code i used -

SAS Code:

DATA REPORT;
FORMAT DATE1 MMDDYY8.;
CALL SYMPUT ('HDATE',PUT(TODAY(),MMDDYY8.));
FORMAT EMAILDATE MMDDYY8.;
PUT "!EM_SUBJECT!" "HDATE11";
FILENAME MYFILE EMAIL
FROM= ("emailid")
TO= ("emailid")
ATTACH=("*.*.*.ZIP" NAME='NYBROK Report'
EXTENSION='ZIP')
TYPE= "TEXT/PLAIN";
DATA REPORT;
SET REPORT;
FILE MYFILE;
PUT "!EM_SUBJECT!" "NY REPORT";
PUT "Please find attached the NY COMSN REPORT";
PUT "run &HDATE . ";
RUN;

Code Used to ZIP using PKZIP:

-TRANSLATE_TABLE_DATA(EBC#xxxx)
-DATA_DELIMITER(LF)
-FILE_TERMINATOR()
-ARCHIVE_OUTFILE(ZIPOUT)
-ARCHIVE_COMMENT(ZIP FOR DMS)
-ENCRYPTION_METHOD(STANDARD)
-ACTION(ADD)
-INFILE(INFILE)
-ZIPPED_DSN(*,*.*.*)

Code used with IEBGENER:

HELO 'server address'
MAIL FROM: <emailid>
RCPT TO: <emailid>
DATA
FROM: <emailid>
TO: <Kumaresan.Neelakandan@COGNIZANT.COM>
SUBJECT: NY REPORT
MIME-VERSION: 1.0
CONTENT-TYPE: MULTIPART/MIXED;BOUNDARY="MIME"

--MIME
CONTENT-TYPE: APPLICATION/ZIP; CHARSET=US-ASCII
CONTENT-TRANSFER-ENCODING: 7BIT

Hi All,

Attached above is the NY BRoker Commission Report for your
reference.

--MIME
CONTENT-TYPE: APPLICATION/ZIP
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=NYBROK.XLS

My requirement is to zip an excel file and the send it as an email.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Dec 15, 2010 2:42 pm
Reply with quote

TYPE= "TEXT/PLAIN";

Does that seem right to you?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Dec 15, 2010 3:27 pm
Reply with quote

Following link gives a nice example :

support.sas.com/resources/papers/proceedings10/084-2010.pdf
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 15, 2010 5:10 pm
Reply with quote

If you're going to use SAS, use SAS and follow the example Peter cited -- or better yet look up on the SAS web site the details for yourself. If you're going to use SMTP, use SMTP and get rid of every bit of SAS code you've got. What you have done is mix SMTP and SAS -- which generally becomes a big mess and certainly will not give you what you think it will.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Dec 15, 2010 5:23 pm
Reply with quote

Robert,

you are totally right, mixing mailing solutions (?) will lead to nothing.
Its the same like mailing part by carrier pigeons AND part by floppy discs.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 15, 2010 5:39 pm
Reply with quote

Peter: and those carrier pigeons REALLY hate having floppy discs strapped to their legs! icon_biggrin.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Wed Dec 15, 2010 7:59 pm
Reply with quote

Robert Sample wrote:
Peter: and those carrier pigeons REALLY hate having floppy discs strapped to their legs! icon_biggrin.gif


Robert,

are you by chance a pigeon fancier? icon_biggrin.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 15, 2010 8:15 pm
Reply with quote

Actually, no -- but I like the image of a pigeon flying along with a floppy disk attached to its leg ....
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 15, 2010 8:45 pm
Reply with quote

shall we start speculating on how having additional surface exposed to the air flow
might let pigeons float better by putting less strain on the wings icon_biggrin.gif ??
Back to top
View user's profile Send private message
Grant Goodale

New User


Joined: 13 Nov 2010
Posts: 67
Location: Brampton, Ontario, Canada

PostPosted: Thu Dec 16, 2010 12:17 am
Reply with quote

Enrico -

It might be carried in the same way as a coconut can be carried by swallows. Then the question is - African or European swallows. icon_lol.gif
Back to top
View user's profile Send private message
Kumaresan.nk

New User


Joined: 22 Mar 2010
Posts: 31
Location: Chennai

PostPosted: Thu Dec 16, 2010 4:36 pm
Reply with quote

Hi,

Now, I'm able to get the ZIP file as attachment in mail. But am not able to get the message that is supposed to be displayed in the body of the mail. I used the following SAS code -

DATA REPORT;
FORMAT DATE1 MMDDYY8.;
CALL SYMPUT ('HDATE',PUT(TODAY(),MMDDYY8.));
FORMAT EMAILDATE MMDDYY8.;
PUT "!EM_SUBJECT!" "HDATE11";
FILENAME MYFILE EMAIL
FROM= ("EMAIL-ID")
TO= ("EMAIL-ID")
ATTACH=("TEST.XXX.XXX.REPORT.ZIP" NAME='NY BROKER REPORT'
EXTENSION='ZIP')
TYPE= "APPLICATION/ZIP";
DATA REPORT;
SET REPORT;
FILE MYFILE;
PUT "!EM_SUBJECT!" "XXX NY BROKER COMMISSION REPORT ";
PUT "Attached is the NY BROKER COMMISSION REPORT";
PUT "run &HDATE . ";
RUN;
QUIT;

Can anyone let me know what might be the issue with this, please.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top