tfh
Volume 21, Number 24 -- June 25, 2012

DB2 For i Modernization Gets Assist From RPG OA

Published: June 25, 2012

by Dan Burger

If you don't know something is broke, is that any reason not to fix it? That's not a trick question. It's another way of saying ignorance is bliss, which doesn't carry a lot of weight in traffic court or database management. You might think you have a get out of jail free card because the IBM i operating system, with its built-in database management system, doesn't need a database administrator, but that little marketing half-truth is exactly what "ignorance is bliss" is all about.

It's true the IBM midrange computer doesn't need a database administrator in the same way that Oracle, Microsoft SQL Server, or Sybase does. Those DBA positions are full-time jobs that add $100,000 annually to the cost of the databases, which are standalone products with standalone costs. But the thing that may have cost AS/400, iSeries, and IBM i users is that most have tended to ignore the database and as long as nothing was broke, there was nothing to fix.

For many companies, this scenario can be described as "so far so good." But the future, with its insistence on open and distributed systems, may not be so kind.

This is not a story about the sky is falling. It's a story about what you can do to prepare the wealth of information in your database for modern times, which means that data, in a lot of cases, needs to be accessible to more than just RPG and COBOL applications. It also means the DB2 for i database is capable of much more than what is currently being asked of it.

Just as modern RPG is modular, modern DB2 for i development is modular. In either case, modular is the opposite end of the spectrum from monolithic. Modular development makes code easier to reuse and, at the database level, it means code that has for years been written into each program can be written once and accessed by multiple programs. Obviously, less coding means apps can be written quicker.

The tallest hurdle companies run into if and when they consider database modernization is the amount of coding changes that must take place (just as it is with application modernization that goes beyond screen scraping).

But there are two things to remember about coding changes. The first is that technology has resulted in fewer hand-coded changes than there used to be. The second is that data-centric development removes data processing from the application code, which shortens the app dev process and makes business processes the focal point. When data processing is handled on the database side, it is written once. When it is handled on the application side, it requires coding in each app that is written.

If an RPG (or COBOL) program could be advanced in terms of openness and interoperability with only a few lines of code being changed, would anyone be interested?

Dan Cruikshank, one of the members of the DB2 for i dream team at IBM thinks we may be on the verge of finding out. Cruikshank has been modernizing databases for IBM midrange shops for nearly 20 years using SQL and data-centric programming. He says applying RPG Open Access to this task has made it much easier. There is code available that can help, and by reusing components Cruikshank transforms RPG I/O to an I/O call using the call-level interface, which has been on the platform for many years. The process eliminates rewriting code from scratch. Like anything new, it requires learning unfamiliar skills and new tools, but he says it does not require an army of programmers.

The benefits include reduced IT expenses, derived from enhanced developer productivity, improved application performance and scalability, which comes through reducing CPU consumption and disk I/O operations. Over and above all that is the benefit of keeping data on the IBM i platform.

Refactoring and re-engineering the DB2 for i database to support SQL brings into play a set processing capabilities (replacing single file processing) and functionality that includes automatic key generation with identity columns and sequences, improved online analytical processing capabilities, high-speed text searches, and query optimization. But at what cost? And what if you crash the database?

"In most heritage applications, only about 20 percent needs to be changed," Cruikshank says. "Most companies are not aware of the 20 percent until someone like me points it out. All they see is the 100 percent and that appears to be overwhelming. Once they realize that only 20 percent or less of the application portfolio accounts for 80 percent or more of the resource consumption, then the mountain becomes a mole hill. Changing a handful of programs becomes a no-brainer decision. There are tools that help determine what needs to be changed within the 20 percent, and the truth is that only a few applications--the ones that are truly critical--that need to be altered."

They are easily identified, he says. The first to look at are those that use open query files. Next, look for programs that are doing updates, inserts, and deletes, especially within a loop. These are the programs that are most likely to be shared with programs written in Java, NET, PHP, and all the other possibilities in a hybrid environment. Also consider altering programs with mass reads and/or writes in batch jobs.

"RPG OA comes in because all the RPG programs that are doing updates to the same file now go to a handler that calls the same service program that calls .NET or Java or PHP. With just a few lines of code change, everyone plays by the same rules--rules that are pushed down to the database."

Before RPG OA, which was introduced in IBM i 7.1 and made compatible back to 6.1, the process of converting the familiar DDS-based programs to the DDL-based programs that are used in SQL typically involved a long program rewrite using either SQL stored procedures or external stored procedures using embedded SQL in the RPG program so it would recognize and use the new database access methods. Now Cruikshank writes an Open Access handler that transforms the traditional I/O to call a service program or a stored procedure.

Now you don't need to worry if your newly coded database programs will lock horns with applications and crash the database. Cruikshank explains the benefit of a single relational database with two interfaces as allowing conversion to take place gradually rather than a flip-the-switch-and-pray process. DB2 objects created with DDS can be accessed with SQL and objects created with SQL can be accessed with the native record-level access interface. This allows SQL conversion and the added capabilities it brings without impacting existing applications.

There was a time in the mid-1990s when Cruikshank showed people how to make RPG or COBOL act like SQL, but since IBM decided SQL was the roadmap for the future he says companies are wasting programming dollars by not using SQL. (The SQL runtime engine is integrated and built into the IBM i operating system.) Companies have been slow to see the light. Most have yet to use SQL and some that did have translated RPG and COBOL to SQL on a one-for-one basis, meaning it still looks at one record at a time, which defeats the power of SQL for using sets of data and multiple tables. Cruikshank claims that companies that replace an RPG program that has multiple files with a single SQL view are realizing 10X to 20X improvements in performance. When a batch program is taking too long to run, he says, you can't expect it to run fast when it reads only one record at a time.

To take a deeper dive into the RPG OA techniques, Cruikshank provides code that he uses to write handlers in two published articles. The first is titled Decoupling RPG database IO using Rational Open Access: RPG Edition, which you can find here. The second is titled Accessing SQL Functions Using Rational Open Access: RPG Edition, which can be found here.


RELATED STORIES

Business Strategy Bumps Into Database Deficiency

DB2 for i: The Beating Heart of the IBM i Platform

Get Database Skills for Career ROI

DB2 on i: The Time, Money, and Risk of Modernization



                     Post this story to del.icio.us
               Post this story to Digg
    Post this story to Slashdot


Sponsored By
LOOKSOFTWARE

i can do this! Your IBM i applications there when your people need them. . .

Learn how to leverage the power of mobile technology with IBM i.

Providing mobile access to your IBM i applications
can add real value and significant benefits to your business.

See how easy it is to create compelling, effective
and secure mobile access to your IBM i apps.

You already have time-tested applications that drive the success of your business.
Learn how you can deliver these to mobile users in just days.

The webcast will provide a live demonstration of just how easy it is to create
an iPad-optimised interface for your core IBM i application, using looksoftware's
state of the art drag-and-drop based IDE.

Register for the webcast

www.looksoftware.com


Editor: Timothy Prickett Morgan
Contributing Editors: Dan Burger, Joe Hertvik, Victor Rozek,
Jenny Thomas, Hesh Wiener, Alex Woodie
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

Sponsored Links

Abacus Solutions:  More affordable and flexible alternatives to deliver secondary workloads
New Generation Software:  Announcing the $475 IBM i Query & BI SDK. Order a FREE trial by June 30
Help/Systems:  2012 Solutions Summit. Early bird pricing ends June 30. Save $100!

 

 

IT Jungle Store Top Book Picks

BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

The iSeries Express Web Implementer's Guide: List Price, $49.95
The iSeries Pocket Database Guide: List Price, $59
The iSeries Pocket SQL Guide: List Price, $59
The iSeries Pocket WebFacing Primer: List Price, $39
Migrating to WebSphere Express for iSeries: List Price, $49
Getting Started with WebSphere Express for iSeries: List Price, $49
The All-Everything Operating System: List Price, $35
The Best Joomla! Tutorial Ever!: List Price, $19.95


 
Four Hundred Stuff
HarrisData to Take on ADP with Cloud-Based Payroll

IBM i Apps on iPads Energize BakerCorp

Red Oak Delivers 5250 Emulator for iPad

Rational Team Concert Now Supports Dependency Builds for IBM i

Zend Readies Framework 2.0, Pushes 'Smart Start' for IBM i

Four Hundred Guru
The New Basics

DB2 For i XMLTABLE, Part 1: Convert XML to Tabular Data

Admin Alert: Of Course, Everything I Know About NetServer Could Change

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

System i PTF Guide
June 16, 2012: Volume 14, Number 24

June 9, 2012: Volume 14, Number 23

June 2, 2012: Volume 14, Number 22

May 26, 2012: Volume 14, Number 21

May 19, 2012: Volume 14, Number 20

May 12, 2012: Volume 14, Number 19

TPM at The Register
AMD puts network, chip guru in charge of Opterons

Red Hat pumps up Enterprise Linux to 6.3

Red Hat hits the top and bottom numbers in fiscal Q1

Bromium twists chip virty circuits to secure PCs and servers

HP rolls up virty desktop system bundles for SMBs

Mellanox FDR InfiniBand pushes PCI-Express 3.0 to the limits

Unisys upgrades Libra mainframes with Xeon E5s

HP taps Intel Atom for next-gen Moonshot hyperscale servers

Achtung Penguin! SUSE tunes up Linux for SAP

UV 2: RETURN of the 'Big Brain'. This time, it's affordable

Big layoff (singular) at Oracle on Thursday

Nvidia shows off Tesla K10 performance

THIS ISSUE SPONSORED BY:

Maxava
looksoftware
Abacus Solutions
Tributary Systems
RJS Software Systems


Printer Friendly Version


TABLE OF CONTENTS
The Big Two Four For The Four Oh Oh

DB2 For i Modernization Gets Assist From RPG OA

IBM Tweaks Flex Prices, Offers Flex Services

As I See It: The Three Graces

EMC Touts Successful Data Domain Installation At IBM i Shop

But Wait, There's More:

Power7+ Details To Be Revealed At Hot Chips 24 . . . IBM Says No Passing On Power Systems Rebates To Someone Else . . . Maxava Strengthens Euro Team, Readies iFoundation Grant Awards . . . Gartner Nips Half-Point Off Enterprise App Spending Forecast . . . European Server Market Swoons, Quite Predictably . . .

The Four Hundred

BACK ISSUES




 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2012 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement