I have a small requirement in my current project. I got to know that we can do that using PKZIP but I am not able to use it effectively to get the results what we expected. Please find the below requirement and let us know your solution. Thanks in advance.
We will receive few file names in a PS file as below. We need to ZIP two files into one file and need to Send the ZIP file to email as attachment.
Data In Input File:
HXSRSH.INS2000.FIN1995.DATFILE INS_FIN1995_FILE.txt
HXSRSH.INS2000.FIN1995.CNTFILE INS_FIN1995_CNT.txt
HXSRSH.INS2000.FIN1996.DATFILE INS_FIN1996_FILE.txt
HXSRSH.INS2000.FIN1996.CNTFILE INS_FIN1996_CNT.txt
HXSRSH.INS2000.FIN1997.DATFILE INS_FIN1997_FILE.txt
HXSRSH.INS2000.FIN1997.CNTFILE INS_FIN1997_CNT.txt
The data in the file is like Mainframe File name and PC file name in a row. The first row is a data file and second row is a count file and it continues.
We need read this file in COBOL program and need to ZIP both data file and count file with the proposed file names into one file and need to send the zipped file to email as attachment as described below.
Both files HXSRSH.INS2000.FIN1995.DATFILE with name INS_FIN1995_FILE.txt and HXSRSH.INS2000.FIN1995.CNTFILE with name INS_FIN1995_CNT.txt into a zip file HXSRSH.INS2000.FIN1995.ZIP file using PKZIP and convert the Zip file into Base 64 file then we need to mail the BASE 64 file to email as attachment with name FIN1995_DATA.ZIP. And it continues will end of file.
After receiving the zip file FIN1995_DATA.ZIP as attachment. When we unzip the file FIN1995_DATA.ZIP using WINZIP/WINRAR in PC we need to have data in INS_FIN1995_FILE.txt and count in INS_FIN1995_CNT.txt files.
As I previously worked on the email part, I can perform it using IEBGENER simple boundary concept.
I am much concerned about ZIPPING PART.
• How to zip two mainframe files into a .zip mainframe file with PC file names.
• What are the parameters we need to pass to PKZIP to achieve the results.
• How to convert the .ZIP mainframe file to Base 64 mainframe file in Cobol program.
All this functionality we need to handle in Cobol program only.
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
HXSRSH: Do not, repeat, do not post the same topic in multiple forums. For the most part, the same people respond to requests in all the forums, and they will not respond to common topics in multiple forums.
We do have the same requirement. In the above mentioned process you are executing the PKZIP from JCL. We would like to call PKZIP in cobol program.
How we need to pass the parameters in cobol to call PKZIP.
From above example:
Data in file HXSRSH.INS2000.FIN1995.DATFILE need to copy into INS_FIN1995_FILE.txt and Data in file HXSRSH.INS2000.FIN1995.CNTFILE need to copy into with name INS_FIN1995_CNT.txt and both files need to be zipped into a file HXSRSH.INS2000.FIN1995.ZIP. Then we can convert into BASE64 and we will mail it.
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
You need to find the PKZIP for MVS Data Compression Library manual for your release of PKZIP for MVS. This manual includes sample code in COBOL to call PKZIP and the various options possible. If your site has a license for PKZIP for MVS, you have access to the manuals -- via hardcopy, or via internal web page for your site, or via the vendor.
Sorry for the late reply.
I would suggest you to find which version you are using in your shop?
and please provide me your let me know your JOBLOG(XDC File).
basic way of executing them is as follows: