Absent Member.
Absent Member.
651 views

Any Chance of A COBOL tab

Jump to solution

Can anyone pls advise how to convert below in to COBOL please

https://msdn.microsoft.com/en-us/library/hh485721(v=vs.110).aspx

Are there any MF samples any where that shows C# or VB.bet to MF Cobol?

Thanks

Neil

0 Likes
1 Solution

Accepted Solutions
Micro Focus Expert
Micro Focus Expert

There is a section in the docs that shows COBOL and C# equivalencies for common programming constructs that you can find here:

There is also a video that covers some of this material called the Fundamentals of using Visual COBOL and .NET which you can find as part of the COBOL Rocks Tech Cast series that we did last year.

This is what the converted example would look like:

     $set ilusing"System.IO"
     $set ilusing"System.IO.Compression"
      program-id. Program1 as "testzipfile.Program1".
      procedure division.

          declare startPath as string = "c:\example\start"
          declare zipPath as string = "c:\example\result.zip"
          declare extractPath as string = "c:\example\extract"

          invoke type ZipFile::CreateFromDirectory(startPath, zipPath, type CompressionLevel::Fastest, true)
          invoke type ZipFile::ExtractToDirectory(zipPath, extractPath)

          goback.

View solution in original post

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

There is a section in the docs that shows COBOL and C# equivalencies for common programming constructs that you can find here:

There is also a video that covers some of this material called the Fundamentals of using Visual COBOL and .NET which you can find as part of the COBOL Rocks Tech Cast series that we did last year.

This is what the converted example would look like:

     $set ilusing"System.IO"
     $set ilusing"System.IO.Compression"
      program-id. Program1 as "testzipfile.Program1".
      procedure division.

          declare startPath as string = "c:\example\start"
          declare zipPath as string = "c:\example\result.zip"
          declare extractPath as string = "c:\example\extract"

          invoke type ZipFile::CreateFromDirectory(startPath, zipPath, type CompressionLevel::Fastest, true)
          invoke type ZipFile::ExtractToDirectory(zipPath, extractPath)

          goback.

View solution in original post

0 Likes
Absent Member.
Absent Member.
Thats great info thanks Chris
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.