Category Archives: VisualCOBOL2010

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

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

Extending Visual COBOL 2010

One of the many great reasons for choosing Microsoft Visual Studio 2010 as our development platform for Visual COBOL 2010 is it ability to be extended… which we have done but you equally use third party extensions too.

One of my favourite extensions is the spell checker for the editor, which is great for pointing out spelling mistakes, which for me can only be a good thing :-)

To install the extension, it is as simple as downloading it, clicking on the downloaded file, restarting Visual Studio and using it.

The spell checker I use with Visual COBOL 2010 is:

http://visualstudiogallery.msdn.microsoft.com/en-us/7c8341f1-ebac-40c8-92c2-476db8d523ce

For those interested, here it is in action…