Category Archives: COBOL

Getting started with Windows Azure

As someone has been working with Windows Azure since its early days I understand how much effort it takes to get started with the platform.

Luckily over the last couple of Windows Azure SDK releases the documentation is started to do justice to the platform itself.

Any here are some nice links to get you started:

General Overview Whitepaper http://go.microsoft.com/?linkid=9682907
Official Microsoft Site http://www.microsoft.com/windowsazure/
Updated List of all “How To” Documents for Azure http://msdn.microsoft.com/en-us/library/gg432998.aspx
Video: Lap Around the Windows Azure Platform http://www.msteched.com/2010/Europe/COS322

Michael’s very own “Getting Started with Visual COBOL”

Michael Burgun over at his own blog space has started blogging about using Visual COBOL… Its worth a look as having meet Michael last year I can honestly say he is a very knowledgeable and experienced chap, so I am sure he will impart some of his own wisdom..

The articles are: .NET greenfield development in Micro Focus Visual COBOL 2010
and today’s article, Getting started.

AzureKit and COBOL

AzureKit is a nice piece of source code released on CodePlex by Mark Rendle. The AzureKit makes life much easier for creating, searching, deleting elements in your Azure’s Table Storage.

My idea was that if the AzureKit was easy enough to use, then it could give us a nice way of accessing Azure’s table storage without to hosted in Azure itself.

Given, this idea I recently spend a bit of time exploring the APIs and how they could be used from COBOL and to be honest it was a pleasure to use, so thank you Mark for the good work.

For anyone not familar with Azure Table Storage, it is a structured storage that uses tables.. sounds obvious. It does not have a SQL interface, so it is marked as a NoSQL storage mechanism.

The normal Azure Table Storage APIs are fine but reasonably complicated… perhaps too complicated for most people to use.

The APIs Mark has put together really does make life easier.

The AzureKit provides you with an IDictionary, IEnumerable and IQueryable style interface which for anyone familar with .Net this API style will feel very natural to them, so I think it gives you a nice programming model.

This combined with Visual COBOL’s support for doing ‘perform thru’ on IQueryable objects make its easy to use.. Anyway enough talking time for some code…

      program-id. Program1 as "AzureKitExample.Program1".

       data division.
       working-storage section.
       01 movieTable    type AzureKit.Table.
       01 movie         type IDictionary[string, object].
       01 movieQuery    type IEnumerable[
                                   type IDictionary[string, object]].
       01 movieIQuery   type System.Linq.IQueryable[
                                   type IDictionary[string, object]].
       
       procedure division.
           set type Azure::Account to "mystorageaccount"
           set type Azure::SharedKey to "myverylargesharedkey.........."
           set movieTable to new type AzureKit.Table("Movie",
                            type AzureKit.IfTableDoesNotExist::CreateIt)
           
           *> Delete ALL
           perform varying movie thru movieTable::GetAllRows()
               invoke movieTable::Delete(movie)
           end-perform
           
           *> All two items
           set movie to type AzureKit.Table::NewRow(
                                   "Jaws: The Revenge",
                                   type Guid::NewGuid()::ToString())
           set movie::Item("Year") to 1987
           set movie::Item("Director") to "Joseph Sargent"
           set movie::Item("Rating") to "Worst Movie Ever!"
           invoke movieTable::InsertRow(movie)
           
           set movie to type AzureKit.Table::NewRow(
                                   "Empire Strikes Back",
                                   type Guid::NewGuid()::ToString())
           set movie::Item("Year") to 1982
           set movie::Item("Director") to "George Lucas"
           set movie::Item("Rating") to "Best Movie Ever!"
           invoke movieTable::InsertRow(movie)
           
           *> query
           set movieQuery to movieTable::Query(
                                 "PartitionKey eq 'Jaws: The Revenge'")
           
           set movieIQuery to type System.Linq.Queryable::AsQueryable[
                                 type IDictionary[
                                     string, object]](movieQuery)
           
           set movie to type System.Linq.Queryable::FirstOrDefault[
                                 type IDictionary[
                                     string, object]](movieIQuery)
           
           display movie::Item("PartitionKey") " -> "
                                   movie::Item("Director") " -> "
                                   movie::Item("RowKey")      
         
           *> show the results
           perform varying movie thru movieQuery
                  display movie::Item("PartitionKey") " -> "
                                  movie::Item("Director") " -> "
                                  movie::Item("RowKey")              
           end-perform
           
           goback.
           
       end program Program1.

That’s pretty easy… now what shall I do with the APIs… answers on the comment strip!

http://blog.markrendle.net/

http://azurekit.codeplex.com/

http://msdn.microsoft.com/en-us/library/dd179423.aspx

Programming languages on the rise: Cobol

Although the article/quote below is so true….

Programming languages on the rise: Cobol

It may not be fair to call Cobol a niche language as it was once the dominant language in the enterprise. Grace Murray Hopper, famous for finding the first bug in the early mainframes, helped create the language in 1959 and it’s been enhanced hundreds of times since. Cobol jockeys today get to play with object-oriented extensions, self-modifying code, and practically every other gimmick.

That never earned it much respect in some circles. Or as famous academic Edsger Dijkstra put it: “The use of Cobol cripples the mind; its teaching should, therefore, be regarded as a criminal offense.” The folks in mainframe shops everywhere ignored this note and soldiered on. IBM calls one of the latest releases “Enterprise Cobol 4.2,” but it could as easily be numbered 147.2 or maybe even 588.3. Cobol programmers like the syntax that’s more like a natural language with actual nouns and verbs that form clauses and sentences — a technique that might call Ruby to mind.

While fewer schools are teaching new programmers Cobol, the language is far from dying, with many corporations continuing to invest in their Cobol stacks. A recent search of Dice.com showed 580 jobs mentioning Cobol and 1,070 mentioning Ruby. The bulk of the jobs seemed to involve counting money (“asset management”) and counting doctor’s visits (“Health IT”). While these are some of the same areas that first adopted computers for back-office processing, the work still needs to be done.

Versions of the languages run on JVMs and .Net virtual machines making it possible to migrate code stacks away from mainframes to Linux boxes. Programmers who want to use a more modern IDE can search for plug-ins to Eclipse, a project that is gaining new support.

http://www.computerworld.com/s/article/print/9192822/7_programming_languages_on_the_rise?taxonomyName=Applications&taxonomyId=18

Visual COBOL 2010 R3

For the last couple of months I have been working on next release which is cunningly name:

Visual COBOL 2010 R3

Which is surprising since the previous was called Visual COBOL 2010 R2.

If you are using any of products in the PC and want to get a sneaky look at the future of COBOL then please apply for our beta program..

http://www.microfocus.com/promotions/wwtevcbp0110/default.aspx?page=form