support: Customer Portal
Focused on delivering choice, investment protection and flexibility to organizations with valuable COBOL assets

Veryant Knowledge Base
Home > All Categories > isCOBOL General > User Interface > Modernize your character application
Question Title Modernize your character application

This guide discusses the modernization process of a legacy COBOL application with character-based user interface.
It demonstrates the necessary steps to transform the character-based user interface into a graphical user interface.

The code snippets used by this guide are taken from the modernization examples installed with isCOBOL in the folder sample/modernization.

For an easy conversion of the user interface, it's good practice to have the user interface management programming separated from the backend processing.
The installed example is an application of this kind, with the user interface in a program called "CUSTOMER.cbl", and the data processing in a separate program called "PCUSTOMER.cbl"

The starting point is a character-based screen whose Screen Section definition is as follows:

   01 s1.
      03 "Customer code:"        line 3 col 2.
      03 using cust-code         col + 2 high prompt.
      03 "First name: "          line 4 col 2.
      03 using Cust-First-Name   col + 2 high prompt.

   01 s-func.
      03 "F1=Lookup"             line 23 col 2 reverse.
      03 "F3=Delete"             col + 2 reverse.

And displayed on a window described simply as "display window"

At runtime, the screen shows as follows:

The minimal modification that can be done to the Screen Section in order to convert to a graphical screen is to change text labels and FROM fields to LABEL controls and USING fields to ENTRY-FIELD controls as follows:

   01 s1.
      03 label "Customer code:"              line 3 col 2.
      03 entry-field using cust-code         col + 2 high prompt.
      03 label "First name: "                line 4 col 2.
      03 entry-field using Cust-First-Name   col + 2 high prompt.

It makes sense also to replace the text that describes an action with graphical PUSH-BUTTON controls as follows:

   01 s-func.
      03 push-button title "F1=Lookup"         line 23 col 2
                     size 9 self-act exception-value 1.
      03 push-button title "F3=Delete"         col + 2 
                     size 9 self-act exception-value 3.

And these screens need to be displayed on a graphical window, in our case described as:

   display standard graphical window
           title "CUSTOMER MAINTENANCE"
           cell size is entry-field font
           size 84
           lines 18
           label-offset 10
           control font fixed-font
           handle h-main

After this modification, the screen appears as follows:

Note - if you wish to assign a special attribute to all the fields, for example if you want all the push-buttons to have the SELF-ACT style, you can use the compiler configuration property

instead of writing "SELF-ACT" in every push-button description in the Screen Section.

Even though the screen is graphical it's still not perfect; it doesn't look like a modern and appealing screen. A further effort is suggested in the installed sample in order to fully modernize a screen, such as:

  • Reorder the graphical control and put frames around them to better describe the information that they host
  • Add icons to the buttons and move them to a tool-bar on top of the screen
  • Use different controls where applicable. For example the Gender can be accepted using two radio-buttons instead of an entry-field. This will save you for checking if the user input a valid value.
  • Add a status-bar
Refer to CUSTOMER.cbl in sample/modernization/graphical/3-full-gui for the code using following steps.

After these changes, the screen will look like this:

It's a dramatic visual difference between the character and final modernization screens, with a minimal amount of effort.
We hope our modernization samples and this guide help you over the first hurdle of getting started.

Authored by: Veryant Support This question has been viewed 1565 times so far.
Click Here to View all the questions in User Interface category.
File Attachments File Attachments
There are no attachment file(s) related to this question.
How helpful was this article to you?
User Comments User Comments Add Comment
There are no user comments for this question. Be the first to post a comment. Click Here
Related Questions Related Questions
  1. How to copy data from the clipboard
  2. How do I center a window on the desktop?
  3. UNC Paths with Browser Control don't work. What can I do to solve it?
  4. Does isCOBOL provide GUI design support?
  5. iscobol.font.default and DEFAULT-FONT
  6. What are the specific fonts that isCOBOL uses by default?
  7. Can I have an entry-field that more or less works the same as Google Search? So I would like to be able to change the contents of the list while the user is typing...
  8. Did you know isCOBOL has the Accordion control?
  9. Does isCOBOL provide Graph modules to show statistics?
  10. Is it possible to sort dates in a grid control?
  11. Working with a grid control is there a way to get the double-click event?
  12. How can I show an animated gif with isCOBOL?
  13. How can I refresh the current contents of the paged grid?
  14. Is there a way to show leading zeros when numeric data items are displayed on a character based screen?
  15. Did you know isCOBOL supports a tip inside the entry-field and combo-box controls when they are empty?
  16. Did you know how to customize color of the borders of some controls?
  17. Is it possible to configure the color of the read-only entry-fields?
  18. Did you know that you can protect a Grid from editing without coding any event?
  19. Gradient effects
  20. How to add pages and GUI controls inside them to a tab control dynamically?
  21. How to detect if a computer has more than one monitor and use any of them?
  22. Do isCOBOL GUI Screens have resizing capabilities?
  23. How may I display a notification window that requires no user intervention?
  24. How to deploy bitmaps when running in application server
  25. Can I modify the GUI controls of a Screen program from a called routine?
  26. Modernizing your COBOL application by using isCOBOL Compiler code injection
  27. How to use font-based icons in isCOBOL GUI programs
  28. How to adjust program screens to different screen resolutions.
  29. How to add helpful options to the Status-Bar control
Article Information Additional Information
Article Number: 327
Created: 2022-04-19 5:10 AM
Rating: No Rating
Article Options Article Options
Print Question Print this Question
Email Question Email Question to Friend
Export to Adobe PDF Export to PDF File
Export to MS Word Export to MS Word
Bookmark Article
Subscribe to Article Subscribe to Article
Search Knowledge Base Search Knowledge Base


© Veryant - All Rights Reserved
Veryant and isCOBOL are trademarks or registered marks of Veryant in the United States and other countries. All other marks are the property of their respective owners.