Search This Blog

Tuesday, November 24, 2015

What's Your Language?

Introduction


Human nature has a strange way of not letting a person recognize valuable information or ideas, even when they are right in front them. Advertisers and sales people are always trying to draw your attention away from your current interest to the ‘newest’, ‘latest’ or ‘most innovative’ bauble. You and your company have a very valuable corporate asset that’s been in place for a number of years, silently working in the background to make you and your company profitable: your COBOL based applications.

Now bear with me, I know what you’re thinking… “COBOL??? You have GOT to be kidding!”. Yes, COBOL. Whether you “speak” Java, C#, RubyOnRails or any of the other newer languages consider what it is your COBOL applications have been doing all these years, what you’re looking for in a new or replacement application (or language) and the estimated costs of replacing those COBOL applications in terms of both effort and risk. There is significant value in the applications that have been running your business.
Silent Partner
 

COBOL has been a silent partner in your company’s success. It has been providing information to you day in and day out for too many years to remember. Yes, it’s old but honestly… so what? It is still doing the job for which it has been designed for, to process data and provide a competitive advantage to you. Yes technology has changed and you keep hearing “COBOL can’t do that”. The truth is it probably can but more on that later.  So COBOL has been processing the data it’s been receiving all these years, analyzing it, generating reports and keeping the lights on for your organization. The people who designed and maintained the application(s) may have moved on to other companies, are retired or in worst case have passed on. Yet the COBOL application they created is still doing its job and you want to replace it with ‘the shiny new bauble’. Why?

What does that bauble have that COBOL doesn’t? Is it a new user interface? Is it the ability to support web services, including JSON and REST based services? Is it the ability to process XML data or access .NET or JVM classes and extend your applications reach to these new platforms? Are you trying to get to a mobile platform? If you answered ‘yes’ to any or all of these questions then you need to take another look at COBOL. All of the technologies or techniques mentioned are supported or obtainable from your current COBOL application. The key is knowledge and being able to research the capabilities of the language, which is where IBM and Micro Focus come into the picture.

Skills Shortage


All the CxOs of your organization, and perhaps you as well, have heard is “COBOL can’t do that” or “COBOL is dead” or “no one is teaching COBOL anymore”. Some companies have had advertisements out for COBOL developers for months and haven’t had a single qualified applicant. They interpret this as validating the information they’ve been hearing all along, that COBOL is indeed a dead language. This however is far from reality.

Two of the largest COBOL vendors in the world, IBM and Micro Focus each provide a wealth of training scenarios.  From basic language courses to more advanced topics in integration with the new technologies. The IBM approach is more mainframe centric and can help you get new developers up to speed and productive in a short period of time. Micro Focus can also provide training for the mainframe centric developer but it can also provide training for those developers working in a distributed environment and looking to access new technologies such as .NET or JVM frameworks. Additionally Micro Focus has created an academic alliance with secondary education facilities around the world to help those institutions teach COBOL.

Rather than trying to hire a ‘COBOL programmer’ why not look for a developer already familiar with Visual Studio or Eclipse? New developers coming out of technical school, college, or existing developers looking to make a change in their career know one or in most cases, both of these development environments. The biggest obstacle, objection, learning curve to learning COBOL has been the environment in which it was maintained in. This should no longer be an issue as both Micro Focus and IBM have adapted the Eclipse environment and Micro Focus has even extended the development experience to Visual Studio. Developers already know these IDEs, they know how to manipulate the environment and are generally already productive in it. So a significant part of the learning curve has just been eliminated. So what’s left? The language…

Parlez-vous français?


While I do not speak French I can understand the basic constructs of the language, common phrases and can decipher enough to ask for help in translating it to English, which is my primary language. I can do the same for German and Russian. In actuality, anyone of us can do the same. We learn a primary language and through necessity, want or influence learn additional languages as we grow in our lives and expand our circle of friends and co-workers. The same can be said for computer languages.

I am a COBOL developer at this point in my career. I didn’t start out that way, but I learned it. The very first language I learned was Pascal. I then went on to Visual Basic, COBOL, JCL, SQL, SAS, CICS, REXX, Windows Scripts, VB.NET and finally C#. I am more fluent in computer languages than I am in spoken languages. What is the difference in all of these languages? Syntax. As a developer I know and understand how to formulate a series of expressions into a comprehensive set of instructions that instruct the computer to perform a series of tasks to complete a unit of work. Regardless of the language, the underlying logic flow is very similar in all circumstances. HOW I choose to implement the requirements is based on the environment in which I am running in. I may be coding a series of expressions in C# in the morning and a different set of expressions in the afternoon in COBOL. The language used is determined by the environment being employed and the requirements of the request. One constant though in all of the languages noted above is Visual Studio. I use Visual Studio for all my coding.

Any developer in the workforce today knows at a minimum three programming languages. These are dependent on the environment they are working in, but at a minimum, three languages. They can switch between these languages with ease (ok, you may have to stop a second to think about the syntax) and complete tasks quickly and efficiently. Why can you not add COBOL to that mix? You already know your development environment. You already are multilingual. You can adapt to the requirements of the request. You can learn COBOL and you can become a more strategic resource to your organization while expanding your career into areas never dreamed of. COBOL truly does run the world of business and you can help integrate it with the new technologies available.

COBOL: No longer a silent partner


COBOL has come a long way with new syntax, new interfaces, new techniques that could enable your application to take a drastic step forward. Instead of trying to replace COBOL, why not work alongside it to achieve rapid, stable results for you and your company?

You didn’t know the languages you are working with today, you learned them through spending time and writing code. Spend some time and write some COBOL code in Visual Studio or Eclipse. You’ll see you can do it and you may even say it wasn’t that bad.
 
Happy COBOL Coding!

 

Thursday, September 11, 2014

Want to Learn O O?

Yeah, I know....

I've been quite for some time.  It's like I went out for a ride and never came back.  Well it is a 600 hp Mustang after all... :)

Short answer is that my job changed and I've just not had time to do much with the blog.  I'll try to do better.

To get started, what better way to jump back in by offering free training?   Well, I'm not actually doing it but...

Micro Focus is starting up a new series of training sessions for those that are interested on the ins and outs of Object Oriented COBOL.  You can register for the seminar by visiting this website location.

From the description of the sessions, it should go a long way in helping you to start taking advantage of the OO support in the Micro Focus Visual COBOL product.  And I'm thinking the concepts should translate to the other tools out there that support OO syntax as well.  You'll just have to deal with syntax differences between each vendor's implementation I'm thinking.

That's all for now. 

Thanks!

Monday, May 20, 2013

COBOL Developer Days in Chicago and Atlanta


Hey folks,

Just a quick update...

Micro Focus is holding a free one-day technical workshop this June that you might want to attend.  The workshop was created for the COBOL developer wanting to learn more about the next generation of the COBOL language when used with Micro Focus Visual COBOL.

It is being held twice, once in Atlanta Georgia at the JW Marriott in Buckhead on June 18th and again in Oak Brook (just outside of Chicago) at the Chicago Oak Brook Marriot on June 20th.

Click here to register

Thanks!

Tuesday, December 11, 2012

Free Mainframe COBOL Developer IDE


If you are currently logging onto a mainframe to do COBOL application development, you now have access to a free graphical editor.  Visit http://online.microfocus.com/Enterprise-Developer-PE and download your own copy of Micro Focus Enterprise Developer for free!

It works with either Eclipse or Visual Studio and is 100% free.  Use it at work or take it home.  It beats the heck out of logging onto TSO and won't require you to go get a purchase request approved by the bean counters. 

For those of us who are a bit thrifty (you know who you are), it could also make a great Christmas gift for your cubicle mate!  Then they can't say you never got them anything. *grin*

Friday, October 26, 2012

COBOL is Trending UP

As we all know, COBOL has been announced "dead" or "dying" multiple times over the years.  And for many shops it has left the building as the applications written in this language have been replaced with packages such as SAP and PeopleSoft.

What you may not know is that COBOL has recently climbed from the bottom end of the Tiobe Programming Community Index to a healthy 26th spot on the chart. 

How high will it climb?

Monday, April 23, 2012

COBOL Today

Where else is COBOL being used?

When I get asked this, my first impression is that the person asking feels all alone in their use of the language, almost ashamed, believe it or not. 

The media, tool /software vendors, consultants, and even college professors have made the statements telling us all how COBOL is the "old" and we should be doing the "new".  They've done a good job promoting the fact that if you are using the new gadget then you must be missing out.

My answer to them is always the same.  COBOL is an ever advancing language and is as current and modern as anything else out in the market.  COBOL is in use every day in literally thousands of companies.

But the number is shrinking.

And I believe it is because of this perception that "we must be all alone".

Well, I've got news for everyone...  COBOL is still alive and kicking.

The problem is that no one is waving a flag saying "We use COBOL".

Yes, usage is down.  The numbers will continue to shrink until reaching an equilibrium or point of balance. 

Here's why - Back when COBOL took the stage, there were only so many options available to a company.  Nowadays, there are literally hundreds if not thousands of ways to create and deploy a business application. 

How many companies will be using COBOL in 5 or 10 years?  Idunno. 

I think a very scientific number will be "a bunch of them".  Not as many as there were, but enough to be significant.

Today thousands of software companies, banks, insurance companies, manufacturers, and credit card processing companies are spending millions of dollars on their COBOL applications.  And they will continue to do so.

As for those of us who write COBOL applications and are trying to figure out what they should focus on for the future, my advice is simple: 

Learn a framework like .NET and become somewhat language independent.  Learn as much as you can about how to leverage things like .NET and other technologies that are used within your shop.  And use your expertise with COBOL to become the expert at briding that gap. 

My buddy Doby!
Learn some new tricks!

Wednesday, February 29, 2012

COBOL Developer Conference. Ya'll Come!

If you or your company has an investment in COBOL, you need to be in Dallas in April for the 2012 Micro Focus Developer Conference.  Micro Focus will be hosting this event at the Crowne Plaza Hotel in downtown Dallas Texas.  Registration starts at 5:00 p.m. April 16th with sessions running the 17th and 18th all day.

Want to know where COBOL is headed?  Trying to figure out how to take advantage of the years of application code that run the business?  Can you take COBOL to the Cloud? 

All good questions.  And this is the place to find out.  Best of all, admission is free!

To learn more, visit the registration site by clicking here!

Wednesday, December 14, 2011

Visual COBOL Now Supports Dialog System Applications

Once upon a time, Micro Focus introduced a slick little piece of technology known as Dialog System.  Its purpose in life was to allow the COBOL developer the ability to build nice looking user interfaces.  In its day, there was nothing better.  Thousands of applications were built using the tooling and everyone was happy.

Then along comes .NET and what was once "leading edge" soon became somewhat obsolete.  But those that build applications using Dialog System were left hanging. 

What do you do with these applications? 

If you are the application owner, reworking them as WinForms or Web Forms was a manual effort at best.  If you are the CIO, having your team completely rewrite these applications just because you wanted a slicker UI was often more work than could be justified.  And Micro Focus hasn't had much of an answer for converting these applications either. 

That is up until now...

With the latest release of Visual COBOL R4 Update 2, Micro Focus is providing tooling to allow you to continue to work with your Dialog System applications or begin the process of converting them to something else.

Yes, its true!  You can either keep them "as is" and continue to support them or you can begin to modernize your user interfaces as it makes sense.  With this new release, there is no longer a need for an "all or nothing" approach. You can either start taking advantage of .NET elements within the existing Dialog System application interface or you can begin moving completely out of Dialog System.

For instance, you want to introduce WPF into your Dialog System application?  Go for it.  You want to drop a .NET grid control into you interface?  Not a problem. 

So, if your shop has an application written using Micro Focus Dialog System screens, you now have options.

For more information, check out the online docs here

Enjoy!

Thursday, August 11, 2011

Object Oriented COBOL Fundamentals




Hey folks!
 
Trying to figure out how to transition from procedural COBOL to object oriented COBOL.
 It's nowhere near as hard as folks make it out to be.
 For those new to the site, check out some of the older posts for examples, etc.
 Additionally, there are some really good recordings out on the Micro Focus Community site (http://community.microfocus.com/) that cover the basics of writing object oriented COBOL.

Check out http://tinyurl.com/3czefpm for the first video in the series.
 You'll need to register for the site to see the video (don't sweat it...membership is free *smile*)
 If you need a copy of Visual COBOL to try some of this out, you can download an eval copy at http://visualcobol.microfocus.com/
 Enjoy!

Wednesday, July 20, 2011

Sunday, June 12, 2011

The COBOL Challenge


(Buy this T-Shirt at Zazzle.com)
 What if I could show you how to take advantage of the COBOL you have today? 

Regardless of whether you still have COBOL developers or not.  I'm talking about me showing you how to  take advantage of your COBOL even if you have long since decided to move away from COBOL and have moved on to .Net or Java.

If I give you free software, free training, and free international publicity, would you be interested in finding out if the COBOL still has value for your company?

"Tell us more Robert!", you say with open curiousity. (at least that is how the voices sound in my head)

I'm willing to offer up arranging for you to get temporary licenses of Micro Focus Visual COBOL, some training on the product, and maybe even some help doing the work, if you'll let me tell the world about it.  You and your company can remain anonymous if need be, but I want the story...

COBOL is still the right tool for the job and I want to prove it to you.

I'm especially interested in working with someone in Georgia or Florida (where I spend my time nowadays), but will make this open to one and all.

Let's get creative! 

Want to find out if you can mix C# with existing COBOL? 

Want to transform traditional procedural COBOL into a bunch of objects? 

Want to see if you can deploy COBOL to your JVM?  Or try to tie your customer portal to your backend COBOL application?  I'm game.

If you are interested, send me a note to robert.collins-at-microfocus.com

COBOL is more relevant today than it has ever been.  And I can prove it.

Wednesday, June 8, 2011

Are You Getting the Most Out of Your Tools?

I've posted a similar questions in the past.  Once I asked my readers "who has learned something new about COBOL recently?".  Very few people were able to raise their hand. 

The reality is that most people learn how to do something one way and continue to do it that way from then on.  And in many areas of life, this makes sense.  No need to reinvent the wheel. 

Hence my question in the title:  Are you getting the most out of your tools? 

The tools have advanced, the COBOL language has advanced, but have your developers?

I met with a company today who uses Micro Focus Net Express, the pre-cursor to Visual COBOL.  After just a few minutes of conversation, I was able to point out some features in the tools they already own that may save their development team significant time and aggrevation. 

I offered to have Jim, my code slinging partner in crime, come by and take a look at what they do and how they are doing it.  I did this with the idea that maybe we can show them a thing or two about using Net Express which could make life easier.

It might be worth revisiting what you can do with the COBOL of today.  Thanks to tools like Visual COBOL I think you may find some extra money in the bottom of the box the tools came in.  I'm just sayin...

Tuesday, June 7, 2011

Why Build a Reference Environment?

If you are selling cars, it is as simple as "why don't we take her out for a spin?" to show off the car.  When talking about changing the way things will work, it's not that simple.  Folks don't just want to see a simple demo.  Oh, they do expect you to make it look simple, but what you focus on can't be the easy stuff. 

For instance, its simple to demonstrate executing a COBOL program via a CICS transaction.  That's core to what our company does.  But  when a customer wants to see things like "interfacing with a scheduler" and "managing our printers" and "how will operators will manage the platform", you have to have something a bit more robust.  Otherwise you end up doing endless proof of concept (POC) projects to move things along.

A reference environment  lets you demonstrate how the end result will look without having to say "I'll get back to you" or "there are a number of ways that might work".   It allows your customer to focus on the "how do I take advantage of this?" versus "will it work?".  Think of it as a pre-fab POC you can use over and over. 

Its why I've been building one for the last few months...(read more here).  Keep this in mind when you try to sell the boss on the idea of turning that COBOL application into the next killer app based on web services and the .NET framework.  He'll be more inclined to consider it if you have an example.

Monday, May 30, 2011

COBOL and the CIO

Last week I had the opportunity to attend a CIO Forum here in Atlanta.  Two topics seemed to be at the top of everyone's list: cutting costs and mobile devices. 

On the cutting costs topic, almost every CIO there had a story to tell about how they were surviving in this economy.  They were doing it by reducing their costs so that they could survive on the same or smaller budgets than they had last year and the year before.  And they were expected to provide more value to the business than ever before.  Do more with less seems to be the mantra of the day.

On the mobility issue, again most of the attendees talked about how they were being pushed to provide accessibility to their corporate systems by their users/business groups for smartphones and notepad-type devices.  More and more people are plugging their own hardware into their corporate networks and expecting them to not only work, but be supported and leveraged.  As you can imagine, this is causing quite a bit of work for some and creating unique opportunities for others.

I have some good news for them.

Sounds like a job for COBOL! (this is a blog about COBOL after all *smile*).

To help with cutting costs...  why not reuse the business logic that has been captured in the COBOL code and repurpose it?  Turn those old routines into components/services  and redeploy them.  Put together a new UI, combining new features with existing processes.  It is relatively easy to do using tools like those from Micro Focus (I'm sure the other COBOL tool vendors have comparable solutions too).  Either way, reuse the existing code!  No need for those costly "green field" development projects.

One of the large insurance customers that is on your side recently did just this.  They took an old application that was written in COBOL, cut out the screen section logic, restructured the business logic as methods and classes and intermixed these routines with C# and a new Winform interface.  Within a 90 day period, they were able to do more work with a team of 5 or 6 than an entire dev team of 20+ was able to accomplish in 2 years.  Reusing existing application source saved them millions.

To help with the challenge presented by all of these new mobile devices, again, use your COBOL assets and provide your users new ways to access the information they need.  Let me give you an example of what I'm talking about.

While at the forum, I had the pleasure to speak with a fellow from a university down in Columbus Georgia.  He walked me through how they were providing their students smartphone apps which interfaced with their back-end applications (yes they were COBOL).  They could access their account details on their phones, their Ipads, on the college computers, etc.  For the IT team, it was nothing short of brilliant.  For the students, their reaction?  *Shrug*  They thought this was how it was supposed to work in the first place.  Go figure *grin*.

So, my message is this.  Companies are starting to figure it out.  COBOL is relevant in today's environment.  How are you making it relevant in your business?

Tuesday, May 24, 2011

COBOL Didn't Blink...The Development Environment Did


Why does COBOL wear the black eye that it has been proudly wearing since the 70's? 

It is because the most common development environment people associate with COBOL is the green screen ISPF mainframe editor.  Yuck! It is still what many COBOL developers use today.

Micro Focus did make in-roads into many companies during the past 30 years, but the majority of COBOL developers are still stuck on character-based interfaces developing application code.

No one really wants to use those tools.  Go figure.  Who'd want to pet an ugly dog?  Not me. *smile*

I personally believe this is the reason that COBOL fell out of favor with the "up and coming" development world that has evolved during the last couple of decades.

The good news is there are options which allow companies to bring all of that application source forward into the same world C# and Java developers live in. 

  • COBOL that runs on the mainframe?  Duh.
  • COBOL and C# in the same application?  Sure thing. 
  • COBOL and Java living together in perfect harmony?  Yep. 
  • COBOL and VB.NET side by side?  Why not? 
  • COBOL as managed source (.NET or JVM)?  But of course.
  • COBOL in the Cloud (Azure, Amazon, etc)  Yes it runs in the Cloud!
(COBOL is the only language that does all of these things.  I bet you can't prove me wrong.)

Today you have options.  Developers can use a single IDE such as Visual Studio or Eclipse and do what needs to be done.  Today's developers are no longer tied to a specific language.  They can use what makes sense for the task at hand, mixing a bit of the old and new with no issues. 

It isn't the language that caused the blip in usage, it was the development environment.

Good news is that this has changed with Visual COBOL.  I believe COBOL will be the language of the decade for companies looking for flexibility.  Hide and watch.

This is why I don't take them to Walmart

Thursday, May 5, 2011

More Performance!

I was just informed that the upcoming webinar on May 11th being hosted by Micro Focus will be focused on COBOL and performance. And that Alex Turner will be doing the session.

Set your VCR's to record!!!! (ok, truthfully... how many of you still have VCR's? Show of hands. Uh huh. That's what I figured. And they still all blink 12:00 a.m. don't they? *grin*).

To sign up for the session, click here.

May 11th is also my mother's birthday. Happy B-day Ma!!!!

I got you a cake!

Friday, March 25, 2011

COBOL and Speed: A perfect combination

I've been asked a few times in the past if I had any suggestions for "best practices" or "how to write the fastest code possible" when coding COBOL. And I'm almost always stumped for an answer that is beyond one or two sentences.

Well, I'm now in luck.

One of the developers at Micro Focus has posted an article on the community website (http://community.microfocus.com) which covers this very topic.

You can find the article at http://community.microfocus.com/library/articles/84_Coding_for_speed_size_and_portability

In his article, you'll find some pretty good tidbits which will have your code screaming along in record fashion in no time.

Which brings a question to mind...

How often do you review your application source to see if you can make it better? Once in awhile? Never? Only when it breaks?

I once had a programmer who worked for me dig into a rather complex piece of long running code (sometimes upwards of 20 hours). He was able to rewrite the routine and reduce the clock time to less than three minutes on average. No I didn't write it originally *smile*. But it goes to show you that you shouldn't overlook doing a review of the source once in awhile to see if there is a better way to do things now that you are older and wiser.

Just a thought!

See ya.

Monday, March 14, 2011

Datagrids, ADO.Net and Cobol

The last few months have had me focused on an internal project which involves multiple pieces, some of which are Micro Focus products, while others are from partners such as HP, LRS, Syncsort, Microsoft and CA.

And as such, I haven't had much time to dig into using my new favorite tool, Visual COBOL.  That's left me sad *smile*.  To fix this, I spent part of my weekend writing code.  It sure beat raking leaves!  (Ummm... I'll get to it next weekend I promise dear).

One of the things I figured out was how to create an ADO.Net datatable, add fields to it, populate it with data, and tie it to a DataGrid.  It's pretty easy actually.

First thing you do is define a variable in working storage that can hold the definition of the table.



Then in my program I create a new instance of the table and store it in this variable.



And then I added a column to the ADO.Net datatable by first defining a variable in Working Storage that could hold the definition of a column:




And then doing the add like so:



After that, it was just a matter of setting the various properties of the column:


And adding it to my datatable.

Once I had the table defined, I linked the datagrid control I had placed on my Winform to it.



Now that the data table has been defined, it is just a matter of adding some data to it.  To do this, I had to first create a new row in the datatable. 




And then once that was done, I inserted data into that row matching its definition:

The only tough part was figuring out the syntax of adding a row to the table. In VB.Net, the statement would have been:


Trow = Tbl.NewRow()

But as you can see, in Visual COBOL, I had to first set the data type of the field and then add it to the table.  What's an extra statement among friends right? *smile*

The last set statement above uses the Now method of System.DateTime and stores it in the column I created.  The "ToShortDateString" at the end of it allow me to choose the format of the date string being stored into the column.  I could have just as easily accepted the current-date from the system clock and placed it in there.  But I thought I would try the .Net method instead.

Fairly simple.  Once I figured all this out, it didn't take long to expand on things and create something I could toy around with...












 Yes, I know it isn't that impressive, but I now know how to create an ADO.Net data table, populate it and link it to a datagrid.  And so do you by the way *wink*.

And I'm betting neither one of us knew how to do it before you read this.

See, I can learn new tricks *smile*

Tuesday, February 1, 2011

It's All About Community

Micro Focus has recently launched a new community site for those who use the many different tools the company produces.  For those that haven't visited as of yet, click on community.microfocus.com and take a look.  You'll find forums, blogs and articles dedicated to each product area, not just COBOL.

For instance, there are sections on DevPartner, Silk, and i.Sight (Modernization Workbench) and so on and so forth.  Of course the COBOL sections are the best, but then again maybe I'm biased in some way :).

While still in its infancy, I believe it has potential to turn into something rather useful.  I would like to encourage you to post on the site and share your ideas/questions, etc.  I'm a firm believer that you'll only get something out of it if you put something in to it.  Yeah, I said that. *smile*

I've already found a pretty interesting post on the site showing how to do a mail merge using Visual COBOL and Microsoft Word.  Pretty slick stuff and something I've often wanted to do myself.  I wonder what else someone will post?  I'll just have to keep checking back huh? *wink*

Oh well, lunch break is over.  Gotta get back to it.

See ya!

Thursday, December 2, 2010

How to be Controlling

During the project I mentioned last posting, the C# expert created several custom controls using COBOL which we used on the various WinForms in the application.  I myself have never done anything with user controls and since I haven't seen it written up anywhere else, I thought this would make for a good topic for discussion.   How do you create a custom control using COBOL?

Yep.  I'm glad you asked *smile*

Instead of starting from scratch, I figured the right approach would be to capitalize on work done by others.  And by taking that approach, I found an article at http://knol.google.com/k/creating-custom-controls-with-c-net# which made my job easy.  The article spells out how to create a custom progress bar for your application.  Seems like something useful huh?

 
Before I get started, let me make it clear that I’m not going to go into all the details on custom controls in this article. You can find more information in much greater detail and deeper understanding than anything I could write (in the referenced article for one).  I’m going to spend my time on recreating the same control Dave (the original author) outlined in his post.  The difference is that I’ll be using Micro Focus Visual COBOL and Visual Studio 2010. So, print out Dave’s directions and follow along with me while I highlight the differences.
 Getting Started
First I created the same project using the same name, but instead of C#, I selected to create a managed COBOL Windows Forms Application (didn't want to strain too much by thinking too hard too soon of course).

 
Next, just like Dave, I added a new project to the solution and call it “ProgressBar”, making sure to select managed COBOL Class library as the template.
 I then added the reference to the new project as directed and was ready to create the control.   As with the C# example, Visual COBOL created a shell class program for me to use as a base. And as in the example, I deleted it because I wouldn’t be using it.

 From the Solution Explorer, I selected the ProgressBar project and right clicked to Add a new item, selected “User Control” from the menu and named it “ProgressControl”.  

  Once the user control was created, I set the properties as Dave had them:

  •  BackColor: Window
  • BorderStyle: FixedSingle
  • Size: 148, 14
  • Double-Buffered: True
As for the Code
Since I used COBOL, you’ll notice the code behind page that was created for the ProgressControl is very similar to the C# version.

Next, I added the code to allow for the choosing of a foreground color for the progress bar  and added the “System.Drawing” namespace to the program so that I didn’t have to fully qualify things like “System::Drawing::Color” in my COBOL code. I just want to type “Color” same as Dave did in the C# routine. To do this, I typed the appropriate $set statement at the top of the program. While I was there, I also added a line for “System.Windows.Forms” because we’ll need it later.

You’ll also see I added the variable definition to the working storage section for barcolor.  In the original C# example, Dave typed:
The biggest difference is that I had to write a bit more code for the get and set methods than what the C# had. Not much, but I had to spell out each method, along with its own working storage, procedure division, etc.

 
Once that portion was coded, I had to make a slight change to the code to create the Value property. Because Value is a reserved word in COBOL. So, instead of using “Value” as a variable name, I used pvalue. I placed the the working storage definition directly after the definition for barcolor (see above).

I used COMP-1 because this is the COBOL equivalent of a short Float.  And as with the ForeColor get and set methods above, I wrote the two methods to do what the C# code does:


 Again, you’ll notice that I used COMP-1 when defining the field that is to be used as a short Float. The last bit of code looks like this:

Two items may stand out here. The first is the invoke statement “invoke super::OnPaint(e)”. Simply put, C# uses the keyword “base”, while COBOL uses “super” to refer to the original superset or base version of the method. Dave’s article points out that this particular statement is optional in his simple example but recommended for more complex paint routines. If I had used “self” instead of “super”, the code would be referring to the current version of the method (the code shown above). That would cause a recursive loop where every time the method was called, the first thing it would do is call itself. That situation ultimately consumes the memory of the machine (guess how I know *smile*) causing Visual Studio to abend.

 
The second item which may stand out in this piece of code is that in the C# example, Dave used “Int” to remove the decimal values from the resulting calculation. Instead of dealing with that, I just created a width field with no decimal value. Everything else, I followed the directions provided by Dave. And much to my surprise it worked first second  third time I hit the run button.

Of course I left out all the mistakes I made trying to decipher the C#, but I never claimed to be a C# programmer now did I? That’s what I call my buddy Mike for.  *smile*

Hopefully you find this of interest / value.  If you find any errors in my code or suggestions on how to make this better, by all means, please share!  All contributions greatly appreciated!