Home      Mainframe Forum      Mainfarme Tutorials      IBM Manuals      Mainframe Interview Questions      Mainframe Books      IT News     SiteMap     Downloads


     
 
MAINFRAME - TIP OF THE DAY : INITIALIZE will not initialize FILLER inside a group item.

Google
 
Web mainframegurukul.com

Zip the File on Mainframe and send as E-Mail Attachment

 
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL
  View previous topic :: View next topic  
Author Message
RGBM_SUN1
Member


Joined: 25 Nov 2010
Posts: 2

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Nov 25, 2010 9:51 pm    Post subject: Zip the File on Mainframe and send as E-Mail Attachment Reply with quote

Hi,

My Req is to send an E-mail with an Zipped Excel attachment from Mainframe. i.e. Convert the PS File on Mainframe to Excel file on Mainframe and then Zip it and send it as attachment.

Iam able to convert the PS File into an Excel format file on Mainframe using SAS ODS feature. But not able to Zip it. I have PKZIP Installed on the machine.

//PKZIP EXEC PGM=PKZIP,REGION=0M
//SYSPRINT DD SYSOUT=*
//ZIPCUR DD DSN=XXXX.ABCD.EGFT,DISP=SHR
//OUTARCH DD DSN=XXXX.ABCD.EGFT.ZIP,DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=8196,BLKSIZE=27998,RECFM=VB),UNIT=SYSALLDA
//SYSIN DD *
-ECHO
-ADD
-NOPATH
-ARCHOUTDD(OUTARCH)
-INDD(ZIPCUR)
//*

Then send the Zip file as below using IEBGENER
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/XML
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=REPORT.ZIP
I got a Zip file as attachment. But it gives the error on opening it to Unzip.

CANNOT OPEN FILE: IT DOES NOT APPEAR TO BE A VALID ARCHIVE

Looks like the problem is with the Zip file on Mainframe and not with the E-Mail step. As the same error appears when i FTP the Zippped file to Windows and try Unzipping it.

Can anyone please let me know what parameters are to be added to properly Zip the file. And what should be the CONTENT-TYPE provided in the E-Mail step (Using IEBGENER or SAS)?

Thanks.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.

MrSpock
Active Member


Joined: 27 Jun 2007
Posts: 273

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Nov 26, 2010 6:42 am    Post subject: Reply with quote

I can't help you with the PKZIP step unless you want to include some error messages or anything else that might help.

As far as using MIME for the attachment, I'm pretty sure a binary file would be coded as:

Content-Type: multipart/mixed;

or possibly:

Content-Type: application/zip;

Now, I'm no MIME expert, and you can look this up just as easily as I can, but I think that you have to encode the attachment using BASE64 encoding. If I recall, SAS will properly encode the attachment without you needing to do anything special.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Natarajan
Moderator


Joined: 10 Oct 2008
Posts: 537
Location: chennai

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Nov 26, 2010 5:26 pm    Post subject: Reply with quote

i have tried this 2 years back and it is worked out.
Let me try to get that info for you. In my next post, i will try to give that info to you.
_________________
Natarajan
Chennai
Back to top
View user's profile Send private message Visit poster's website
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
RGBM_SUN1
Member


Joined: 25 Nov 2010
Posts: 2

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Nov 26, 2010 5:45 pm    Post subject: Reply with quote

Thank You.

There are no Error Messages in the PKZIP Step Spool.

-ECHO
-ADD
-ACTION(ADD)
-NOPATH
-PATH(N)
-ARCHOUTDD(OUTARCH)
ZPDA000I DSNAME=XXXX.XXXX.XXXX.CSV.ZIP,DISP_STATUS=NEW
ZPDA000I DISP_NORMAL=CATALOG,DISP_ABNORMAL=,SPACE_TYPE=TRK
ZPDA000I SPACE_TYPE=CYL,SPACE_TYPE=BLK,SPACE_PRIMARY=4194304
ZPDA000I SPACE_DIRBLKS=2097166,INFO_ALCFMT=00,VOLUMES=PRMH05,INFO_CNTL=
ZPDA000I INFO_STORCLASS=,INFO_MGMTCLASS=,INFO_DATACLASS=
ZPDA000I INFO_VSAMRECORG=00,INFO_VSAMKEYOFF=0,INFO_COPYDD=,INFO_COPYMDL=
ZPDA000I INFO_AVGRECU=20,INFO_DSTYPE=40,GETHFSPATH,HFS_OPTIONS=0
ZPDA000I HFS_ACCESS=0,HFS_DISP=,HFS_ABDISP=,HFS_ORG=DELIMITED
-INDD(ZIPCUR)
ZPAM030I OUTPUT Archive opened: XXXX.XXXX.XXXX.CSV.ZIP
ZPAM253I ADDED File XXXX.XXXX.XXXX.CSV
ZPAM254I as CSV
ZPAM255I (DEFLATED 95%/95%) DATA SIZE 379,907; ZIP SIZE 20,366
ZPAM140I FILES: ADDED EXCLUDED BYPASSED IN ERROR COPIED
ZPAM140I 1 0 0 0 0
ZPMT002I PKZIP processing complete. RC=00000000 0(Dec)

Hope this provides some Inputs..
Please let me know if anything missing/wrong in this...
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
MrSpock
Active Member


Joined: 27 Jun 2007
Posts: 273

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Thu Dec 02, 2010 9:56 am    Post subject: Reply with quote

If you want to verify your zip archive on the target system, take a dump of it and look at it in hex. You should see a specific "PK" header as well as the name of the unzipped file in clear text.
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
bharani
Member


Joined: 09 Oct 2009
Posts: 13

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Aug 03, 2012 7:57 pm    Post subject: Reply with quote

Dear All,

Am having the same issue now (Stated above). My requirement is also a similar one. I need to zip one file and have to send it as a attachment in email.

Can anyone help me in this? searched a lot, but couldn't find the solution for the same.


Hi Natarajan, If possible can you guide me please? Am successful to send it as an attachment in .txt format. But facing issue here.

Thanks a lot,
Bharani.S
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Fri Aug 03, 2012 9:49 pm    Post subject: Reply with quote

Quote:

Am successful to send it as an attachment in .txt format. But facing issue here.
What issue? We cannot help much if you do not provide the informaton necessary to help you. . .

Post the jcl, control statements, and diagnostic info (including message ids) frlom the problem run.

You also replied to a dormant topic. It is best to start a new topic when posting a new (even though related) question.
_________________
Have a good one
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
bharani
Member


Joined: 09 Oct 2009
Posts: 13

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sat Aug 04, 2012 1:57 pm    Post subject: Reply with quote

Thank you DikDude, i have posted a seperate topic on this. Also provided some details on this. Could you please help me on this?

new post : http://www.mainframegurukul.com/ibmmainframeforums/viewtopic.php?p=16641&highlight=#16641

Thanks,
Bharani.S
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
DikDude
Moderator


Joined: 22 Jul 2011
Posts: 1001
Location: usa

Answer was approved by Question owner.
Useful Post
0 votes
Not an useful post
Greate Post!! Salute Author
0 salutes

PostPosted: Sun Aug 05, 2012 2:52 am    Post subject: Reply with quote

Thank you for starting a new topic for your question - good job using the Code tags Smile

Please see the reply from MrSpock and do this. If there are questions, someone should soon be here.
_________________
Have a good one
Back to top
View user's profile Send private message
Click here, If this post answer your question. <-- Click on right mark icon. If this post answer your question.
Display posts from previous:   
Post new topic   Reply to topic    mainframegurukul.com Forum Index -> JCL All times are GMT + 5 Hours
Page 1 of 1



 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Related topics
 Topics   Replies   Author   Views   Last Post 
No new posts Need to put records a Sorting order as mentioned below. 13 Yash1911 4428 Wed Oct 31, 2012 8:18 pm
dbzTHEdinosauer View latest post
No new posts how to deal with the below scenario using iebgener 7 mainframes_6002 4509 Wed Dec 07, 2011 10:34 am
DikDude View latest post
No new posts Coulu someone explain the parameters in the below code? 1 lovely sweety 6250 Thu Jun 09, 2011 3:50 pm
dbzTHEdinosauer View latest post
No new posts Unable to achieve below scenario using ICETOOL 24 sirianangel 20526 Sat Oct 23, 2010 12:45 am
Frank Yaeger View latest post
No new posts Query For IEBPTPCH 2 padmajeet.gaikwad 8606 Mon Oct 26, 2009 10:25 am
padmajeet.gaikwad View latest post
 





Cobol Tutorial
This cobol tutorial covers most of the important topics like STRING, UNSTRING, COMP, COMP-3.....
DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. Explains in simple language. Some Chapters are locked, Forum members have free access to these chapters
CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming...
JCL Tutorial
This is most popular JCL tutorial from mainframegurukul. It does contain important jcl ....
SORT Tutorial
This Tutorial covers all important aspects of DFSORT. Has more SORT examples
INTERVIEW Questions
This page covers important interview questions
Mainframe Jobs
Mainframe Jobs posted by members of mainframegurukul forum
FaceBook Page
MainframeGurukul FaceBook Page
LinkedIn Page
MainframeGurkul Linkedin Page

This widget requires Flash Player 9 or better







Go to top of the page
 

Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  DB2 INTERVIEW QUESTIONS ||  COBOL INTERVIEW QUESTIONS  ||  JCL INTERVIEW QUESTIONS ||  JCL2 INTERVIEW QUESTIONS ||  VSAM INTERVIEW QUESTIONS ||  CICS INTERVIEW QUESTIONS  ||  Online tutorials ||  Online ABEND Reference ||  JCL References ||  COBOL References ||  VSAM References ||  Tutorials by Drona Series ||  SQL tutorial ||  BOOKS  ||  SiteMap  ||  Expeditor Tutorial  ||  FILE-AID Tutorial  ||  Changeman Tutorial  ||  COBOL   ||  DB2   ||  JCL  ||  CICS  ||  VSAM  ||  DB2 Interview Questions ( 110 )   || Simple JCL Tutorials  || JCL Tutorial from MainframeGurukul.com   || Simple JCL Tutorial - Chapter1 ;|| Mainframe Forum - Tutorials  || Mainframe Tutorials || Mainframe CICS tutorial|| Mainframe COBOL Tutorial

Drona Educational Forums - Mainframe Cobol DB2 CICS Board
Powered by phpBB

mainframetopic-5477.html