Zip a file in Visual Cobol

Hi,

I want to ZIP one file contained in a PC's local directory.

Can anyone advise how to convert this into cobol?

//Creates a new, blank zip file to work with - the file will be
//finalized when the using statement completes
using (ZipArchive newFile = ZipFile.Open(zipName, ZipArchiveMode.Create))
{
    //Here are two hard-coded files that we will be adding to the zip
    //file.  If you don't have these files in your system, this will
    //fail.  Either create them or change the file names.
    newFile.CreateEntryFromFile(@"C:\Temp\File1.txt", "File1.txt");
    newFile.CreateEntryFromFile(@"C:\Temp\File2.txt", "File2.txt", CompressionLevel.Fastest);
}

Taken from the website:-

www.codeproject.com/.../Creating-Zip-Files-Easily-in-NET
  • Verified Answer

    Hi Neil, should be something like:

    declare zipName = "File.dat"

    perform using newFile as type ZipArchive = type ZipFile::Open(zipName, type ZipArchiveMode::Create)

       *>Here are two hard-coded files that we will be adding to the zip

       *>file.  If you don't have these files in your system, this will

       *>fail.  Either create them or change the file names.

       invoke newFile::CreateEntryFromFile("C:\Temp\File1.txt", "File1.txt");

       invoke newFile::CreateEntryFromFile("C:\Temp\File2.txt", "File2.txt", type CompressionLevel::Fastest);

    end-perform