Remember when green screens were cool?
We all know how fast technology changes. Remember pagers, for example? Not more than ten years ago, when smaller cell phones were first introduced, a friend of mine at the time was ecstatic to have acquired a new “flip” cell phone. While state-of-the-art back then, he might actually be embarrassed if he were to use this device today.
It is not a stretch to assume that any new technology adopted now probably will be obsolete or at least considered "ancient" in ten or twenty years, perhaps even sooner. That might be one reason why there is a strong, ongoing desire to modernize existing applications. And besides, no one wants to use the ugly "green screens" anymore.
So, the question for developers becomes: How can you modernize in an efficient way without being quickly obsolete?
You might decide to redesign and rewrite an existing application using a new technology, but of course there is no guarantee how long that technology will remain current. Adding in the considerable expense of rewriting an application brings even more uncertainty to the mix. These points provide good reasons why you might want to consider reusing available code that is performing well, rather than rewrite or replace it. There is also a need to implement transformations that are as agile as possible, without losing governance or the development control.
This article takes a very simple mainframe modernization example and shows how analysts, architects, and developers can get quick, effective, and reliable results transforming heritage applications using selected IBM Rational products and service-oriented architecture (SOA). It will show how you can reuse existing code and implement a fast transformation using a structured, modern method.
The transformation scenario
The sample scenario we will use here is very simple and common: You must reuse an existing COBOL/CICS® application and transform its old 3270 terminal interface into an iPhone interface – but you must do it with no new application code (other than the presentation layer), and the existing mainframe application must remain functional. Oh, and one more very important and mandatory requirement: the performance of the transformed application must remain at least as good as it is today.
There are several tools and technologies available to help you and your colleagues achieve this objective. The ones highlighted in this example include:
- IBM Rational Team Concert
- IBM Rational Asset Analyzer
- IBM Rational Developer for System z
- IBM Rational Developer for System z Unit Test
- Service-oriented architecture (SOA)
- CICS web services
- CICS Explorer®
- IBM Debug Tool for z/OS®
- Web 2.0
Figure 1 shows the hardware and software architecture used in the implementation of this sample scenario. Notice that there are three laptops in this example: Two (a Mac and a Lenovo T60as) are clients, and theother (a Lenovo W510) was used as a server.
The sections that follow each present a task or problem that one or more members of the project team must address, and the tools or technologies that can help achieve the desired result.
Figure 1. Hardware and software architecture used in our scenario
1. You need an agile development environment using a z/OS system
To save mainframe MIPS and get an agile z/OS development environment, you
Rational Developer for System z Unit Test on your server laptop. In
this example, CICS V4.1 runs in z/OS under Rational Developer for System z
Unit Test, where you can connect to and run the application to be
transformed. Figure 2 shows the green screen terminal that results from a
simple query using this application running on the Rational Developer for
System z system. The user types the CICS transaction
BKXX, selects the View option, and types a
customer number (in this example, customer number
000002). After pressing Enter the data is displayed.
Figure 2. Existing CICS application current 3270 interface
2. You need a structured way to create the requirements and control the transformation changes
Instead of sending e-mails and using disconnected tools to create the requirements, you can use Rational Team Concert with extensions to your z/OS system that is running on Rational Developer for System z Unit Test.
Using Rational Team Concert, an architect or analyst can create the requirements and pass it along to the developer. This requirement is called a work item. Notice that even though your components are deployed in the z/OS system under CICS, the source code in is stored in the Rational Team Concert repository that is installed on Linux® -- the same Linux where the z/OS system and Rational Developer are running (Figure 1). (Rational Team Concert can run on many different platforms, as well as under z/OS, but in this example it is running under native Linux.)
Rational Team Concert can be accessed via web browser or Eclipse interface. Here, the work item is created using the browser, as shown in Figure 3.
Figure 3. Architect uses Rational Team Concert to create a work item
3. You need a tool to identify which existing z/OS components can be deployed as a web service
The analyst mission now is to investigate the CICS transaction BKXX, which needs the transformation.
You could use TSO/ISPF to search the z/OS components used in this CICS transaction to identify which components can be deployed to CICS as a web service, but why not use an automated tool for this instead? Also, what would be the impact of a possible transformation on the existing deployed assets?
Rational Asset Analyzer provides these capabilities. In this scenario, Rational Asset Analyzer is installed on the z/OS system (Figure 1) and can be accessed by anyone with a web browser who needs to understand the existing application and its components. Here, the analyst is uses a browser for this task, and later, the developer will also access the Rational Asset Analyzer database using the Eclipse plug-in that’s installed in Rational Developer.
Using a browser, the architect analyzes the BKXX transaction and determines that this transaction is composed of other transactions and programs, and specifically that a COBOL CICS program called BKPXXS1 is a perfect candidate to be deployed to CICS as a web service.
Figure 4 shows these Rational Asset Analyzer results.
Figure 4. Rational Asset Analyzer browser results during code transformation analysis
With this information, the developer will have the mission to complete the transformation activities after further analysis. Using Rational Team Concert, the analyst updates the work item and assigns the work to the developer, passing screen captures and details about the COBOL program to be deployed as a web service (BKPXXS1).
The work item now has a new owner (the developer) and the analyst’s mission is complete, although he could later review and approve the work done by the developer in Rational Team Concert.
4. You need a simple and efficient way to understand how to transform the code
The developer receives an e-mail notification indicating there is development activity to perform and to access Rational Team Concert to start the work. He accesses Rational Team Concert using Rational Developer for System z, which is his development tool, to access the work item assigned to him.
Figure 5 shows the Rational Developer Work Items perspective, which displays the work assignment with all necessary documentation to enable the developer to start his analysis of the COBOL program to be deployed as web service.
When he starts working on the assigned task he might update the work item, adding planned completion date, time required, and so on. When he updates the work item, anyone subscribing to the task can receive e-mail updates of work in progress.
Figure 5. Accessing Rational Team Concert via Rational Developer interface to update a work item
5. You need to perform deep analysis on the required COBOL code
Using Rational Asset Analyzer, the developer can perform impact analysis in case he decides he needs to make COBOL code changes (none are made in this scenario), identify dead code, and so on. Figure 6 shows an example where the user is analyzing the program BKPXXS1 and understands its logic using Rational Developer for System z.
Figure 6. Developer using Rational Asset Analyzer integrated with Rational Developer
6. You need a tool to create and deploy web services
The developer will wrap the existing COBOL code and deploy a CICS web service, without any COBOL code modifications. This way there will be no impact on the existing application. The developer will use Rational Developer for System z to create, test, and deploy the CICS web services. (See Resources for several articles on creating web services.) Figure 7 shows the Enterprise Services perspective of Rational Developer, which features a wizard for creating a CICS web service.
Figure 7. Creating a CICS Web Services using Rational Developer
It’s important to remember that because Rational Developer is running z/OS, there is no impact on the mainframe. When the service is successfully tested in Rational Developer, the code will just need to be redeployed on the actual mainframe for further testing and finally production.
With Rational Developer and the necessary CICS authorizations, you can deploy CICS web services from the generated components (Figure 8).
Figure 8. Deploying a CICS Web Service from Rational Developer
When the SOAP web service is generated, a WSDL is also created. As you can see, the use of these tools makes it easy to understand how z/OS development can be agile.
7. You need a tool to test and debug the web services to be deployed
Once the web service is deployed, it needs to be tested it. If there are problems, the COBOL code running on z/OS might need to be debugged.
The web service can be tested using the generated WSDL and the Web Services Explorer included in Rational Developer for System z. Figure 9 shows the Web Services Explorer in action. The developer types the input message and receives the response back.
Figure 9. Testing the CICS web service
In case of unexpected results, the z/OS components can be debugged using the integrated Rational Developer debug capability. Using the Rational Developer CICS Explorer capability, you can select the COBOL program to be debugged, and specify the TCP/IP address of the laptop as well the port number that the client is listening on. The z/OS debugger that is running on Rational Developer is activated and the Debug perspective can be used for code debugging, as seen in Figure 10.
(The Rational Developer Debug perspective is the same perspective for debugging other code, such as Java.)
Figure 10. z/OS debug in action
8. You need a modern language to create a Web 2.0 interface
At this point, the scenario is almost complete. The CICS web service is created, deployed, and tested. Now the smartphone interface needs to be created and tested also. This is my favorite piece of the scenario: creating a modern Web 2.0 component that reuses a very old and mature technology. Also in this scenario, this activity is the only one that requires new coding.
Figure 11. EGL code to invoke the CICS web service
You can also use the EGL Web 2.0 graphical editor to drag and drop the user interface component like buttons, drop downs, Dojo widgets, or customized interfaces, as seen in Figure 12. When you click on the Source tab, you’ll see the EGL code resulting from this drag and drop.
Figure 12. Creating the Web 2.0 interface using EGL graphical editor
This EGL graphical editor provides three tabs: Design, Source, and Preview (Figure 12). The Preview tab is useful for testing the Web 2.0 components (Figure 13) and displays the web interface exactly as the user will see it.
Figure 13. Preview EGL editor tab with the data returned from CICS web services
At this point, the mission is accomplished. Using a simple EGL line of code you can check the CICS web services response time. When this sample was initially run, response times of milliseconds were recorded. Remember that the data being sent to CICS is XML; CICS is parsing it, invoking the COBOL program that gets the data from the database, sends the data to be parsed again, and returns it to the client in XML format again.
This impressive speed makes this technology very well accepted. You can use an iPhone emulator to test whether the application can run in the Safari browser (Figure 14).
Figure 14. The existing COBOL/CICS application with iPhone interface
9. You need to communicate the completed work and request approvals
The developer can use Rational Team Concert again, update his assigned work item, and, if necessary, request approval form other people on the team for other tests and a final promotion for production.
We could expend lots of time here, but to make life simpler, we will just end as the developer closing this work item. Figure 15 shows this while he still using Rational Developer.
Figure 15. Resolving the Rational Team Concert work item
This scenario could continue and you could use other capabilities of Rational Team Concert to build and deploy components and perform another level of tests, or even move the new code to production, but hopefully you get the idea that the tools available make the entire process very easy and practical.
This article illustrated a scenario that used state-of-the-art development tools to modernize an existing COBOL/CICS green screen application by moving it to the Internet using Web 2.0 technology, while also transforming the application development infrastructure.
If you are concerned about modernizing existing applications using modern tools, you owe it to yourself to experiment with the products and technologies described here. You might be surprised with the results. IBM even provides a System z Sandbox web site where you can even try some of the products described here.
- Developing mainframe applications on your laptop
- Wrap existing COBOL programs as Web Services with IBM Rational Developer for System z
- Implement a Web service provider and requester using native CICS APIs and IBM Rational Developer for System z
- Hello again, 3270: Accessing z/OS applications with an iPhone
- System z on the Go: Accessing z/OS from Smartphones
- Enterprise Modernization Sandbox for System z
- IBM developerWorks WebSphere