![Page 1: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/1.jpg)
Taking your COBOL apps to .NET
and the Java Virtual Machine
Scot Nielsen
Product Manager
![Page 2: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/2.jpg)
Moving to managed code
• What is managed code?
• Perspectives on the value for COBOL
• Lessons learned
![Page 3: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/3.jpg)
What is Managed code
• Virtual execution environment
– Portable Intermediate Language
– JIT
• Garbage collection
• Object-oriented
• Extensive frameworks/Class Libraries
• COBOL code generated directly to byte code
![Page 4: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/4.jpg)
• Managed code = .NET or JVM
• Native code or unmanaged = everything else
![Page 5: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/5.jpg)
1 C
2 Java
3 C++
4 Objective-C
5 C#
6 Visual Basic
7 PHP
8 Python
9 Perl
10 Ruby
11 JavaScript
12 Visual Basic .NET
13 Delphi/Object Pascal
14 Lisp
15 Logo
16 Pascal
17 Transact-SQL
18 Ada
19 PL/SQL
20 Lua
1 C
2 Java
3 C++
4 Objective-C
5 C#
6 Visual Basic
7 PHP
8 Python
9 Perl
10 Ruby
11 JavaScript
12 Visual Basic .NET
13 Delphi/Object Pascal
14 Lisp
15 Logo
16 Pascal
17 Transact-SQL
18 Ada
19 PL/SQL
20 Lua
Why managed codeAn industry perspective
How popular is managed code?
www.tiobe.com
1 C
2 Java
3 C++
4 Objective-C
5 C#
6 Visual Basic
7 PHP
8 Python
9 Perl
10 Ruby
11 JavaScript
12 Visual Basic .NET
13 Delphi/Object Pascal
14 Lisp
15 Logo
16 Pascal
17 Transact-SQL
18 Ada
19 PL/SQL
20 Lua
![Page 6: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/6.jpg)
Why managed codereuse what already works
![Page 7: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/7.jpg)
Why managed code21st century user interfaces
![Page 8: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/8.jpg)
Why managed codeApplication Integrity
Micro Focus COBOL runtime error:
114 Attempt to access item beyond bounds of memory (Signal 11)
![Page 9: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/9.jpg)
Application Integrity
Quick Demo
Try/Catch Exception handling in COBOL
![Page 10: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/10.jpg)
• Debug C#/Java and COBOL together
• End-to-end testing
• Single IDE for building and testing
• Single debug process
• Same developer
Why managed codeEnd-to-end debugging
![Page 11: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/11.jpg)
Reusable Frameworks
Quick demo:
Date/time arithmetic
Why managed codeA developer’s perspective
![Page 12: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/12.jpg)
Object Oriented Programming
• .NET/JVM are fundamentally built on OO
principles
• Procedural semantics still apply
• Visual COBOL extensions
• Samples browser
![Page 13: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/13.jpg)
Performance
![Page 14: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/14.jpg)
![Page 15: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/15.jpg)
Quick demo:
Calling procedural COBOL from managed code
![Page 16: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/16.jpg)
Data
![Page 17: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/17.jpg)
File Handling
• Good to go in .NET and JVM
• Be mindful of performance for IO intensive
batch operations
• Optimizations this area planed
![Page 18: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/18.jpg)
Database access Primer
COBOL programs can contain embedded SQL
Your choices:
1. Database vendor pre-compiler such as Oracle
Pro*COBOL
a) COBSQL provides single compile-step integrated with the
IDE
2. Micro Focus OpenESQL
a) Connect to any ODBC, JDBC, ADO.NET enabled data
source
procedure division.
exec sql
connect to Northwind
end-exec
if sqlcode not = 0
display "Error during CONNECT : " SQLCODE
display mfsqlmessagetext
goback
end-if
![Page 19: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/19.jpg)
Database access under Managed Code
• Oracle does not support managed code using
Pro*COBOL
• Use OpenESQL for JDBC and ADO.NET
• Use Pro*COBOL directives MODE=ANSI and FIPS to
determine non-standard ANSI syntax
• Some Oracle extensions supported by OpenESQL
other extensions will need to be reworked
• No PL/SQL support
![Page 20: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/20.jpg)
Java App Servers
• To do anything “Thin” will involve an app server
• All major Java App Servers supported in Visual COBOL 2.2
– Tomcat
– JBOSS
– Webshere
– WebLogic
• Web Services and JSPs
• Java coding required
• See community.microfocus.com for walkthrus
![Page 21: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/21.jpg)
COBOL JVM Roadmap
R3/4
JVM COBOL Preview
JVM COBOL Launch
2.0
JDBC support
Pure JVM
2.1
Web Container support under Tomcat
Web services, JSP and Servlet deployment
2.2
Web container support
WebLogic
Websphere
JBOSS
2.3
EJB container deployment
From desktop to J2EE EJB deployment…
…re-use core COBOL applications directly within
the Java Virtual Machine
![Page 22: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/22.jpg)
COBOL
Process
COBOL
Process
COBOL
Process Data
Multi-process applications
![Page 23: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/23.jpg)
App Server
Process
Data
App Servers
REENTRANT(2) directive won’t help
Thread
![Page 24: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/24.jpg)
Run-units as containers• Run units associate COBOL programs, data
and working-storage with a given user
App Server Process
DataThread
Run
unitRun
unitRun
unit
Run
unitRun
unitCOBOL
![Page 25: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/25.jpg)
• COBOL, Java or C#, VB…Presentation
• OO COBOL Wrapper
• Run unitBusiness Access
• Existing Procedural COBOLBusiness logic
• Isolated data IO modulesData Access
• RDBMS
• Data filesData
Modernizing your architecture
![Page 26: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/26.jpg)
Other considerations
• Dialog System
• 3rd Party support
• Win32APIs
• CBL_ routines
• Pointers
• Native code
![Page 27: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/27.jpg)
Case studies
• Midland National Life
• Nationwide
• Zucchetti
![Page 28: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/28.jpg)
28
Mainframe Re-hosting to the Azure Cloud
![Page 29: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/29.jpg)
UI Modernization
![Page 30: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/30.jpg)
Web Deployment
![Page 31: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/31.jpg)
Mashups
![Page 32: NA Developer Day - Taking your COBOL apps to Net & JVM](https://reader034.vdocuments.site/reader034/viewer/2022052606/58edd6181a28ab88078b46b5/html5/thumbnails/32.jpg)
Summary
• Managed code is a fantastic way to modernize your
application
– Get more done using Java and .NET frameworks
– Create new user interfaces and services based deployments
• Be prepared
– New skills – OO, Java, .NET, frameworks
– Check for unsupported options such as APIs and database pre-
compilers
• Speak to Micro Focus before you start or at least, let us know
once you’ve deployed!