Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sending ZIP File in Mail.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: Sending ZIP File in Mail.
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

Moderator Team Head


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

PostPosted: Wed Dec 15, 2010 2:42 pm    Post subject: Reply to: Sending ZIP File in Mail.
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: 2422
Location: Netherlands, Amstelveen

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

Following link gives a nice example :

http://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: 7914
Location: Bellevue, IA

PostPosted: Wed Dec 15, 2010 5:10 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Dec 15, 2010 5:23 pm    Post subject:
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: 7914
Location: Bellevue, IA

PostPosted: Wed Dec 15, 2010 5:39 pm    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Wed Dec 15, 2010 7:59 pm    Post subject:
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: 7914
Location: Bellevue, IA

PostPosted: Wed Dec 15, 2010 8:15 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Dec 15, 2010 8:45 pm    Post subject: Reply to: Sending ZIP File in Mail.
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: 55
Location: Brampton, Ontario, Canada

PostPosted: Thu Dec 16, 2010 12:17 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us