Sei sulla pagina 1di 23

IBM System i

Moving RPG to an SOA Framework;


A Step by Step Overview

Alison Butterill
butteril@ca.ibm.com

i want stress-free IT.


i want control.
i want an i.

Simplify IT
2006 IBM Corporation

IBM System i

Acknowledgements and Disclaimer


Acknowledgment:

This presentation is a collaborative effort of many IBM presenters


This presentation includes some material from Paul Tuohy of ComCon,
Dublin, Ireland and Susan Gantner of Partner400, Toronto, Canada.
Disclaimer:

The information contained in this document has not been submitted to any
formal IBM test and is distributed on an as is basis without any warranty
either express or implied. The use of this information or the implementation
of any of these techniques is a customer responsibility and depends on the
customers' ability to evaluate and integrate them into the customers'
operational environment. While each item may have been reviewed by IBM
for accuracy in a specific situation, there is no guarantee that the same or
similar results will result elsewhere. Customers attempting to adapt these
techniques to their own environment do so at their own risk.
Reproduction:

This presentation is the property of the IBM Corporation, ComCon and


Partner400. Permission must be obtained PRIOR to making copies of this
material for any reason.

i want an i.

RPG Modernization

2006 IBM Corporation

IBM System i

Why SOA?
Does this sound like applications in your shop?
Have difficulty in adapting applications for business changes
Functionality within applications is not modularized to support reusability
High costs, time consuming and lacks integration across business units
Application portfolio misaligned to business strategy
Proprietary applications are fragmented and unable to talk to one another
Lack enterprise-wide, cross-data sharing capabilities
IT resources are tied up with no bandwidth for new projects
Uncertainty about the long-term role of the existing portfolio
Difficulty linking applications to modern technologies

Does Implementing SOA Help?


i want an i.

2006 IBM Corporation

IBM System i

Why Modernize?
The interface is changing.
yThe preference is for GUI as opposed to green screen.
yIntegration with new architectures requires modular code

The Choices
yGet new applications.
yModernize current applications.

Considerations
yProtect investment in current working code.
yProtect investment is staff who understand the business application.
yProtect investment in staff who understand the code.
yReduce the maintenance overhead.

Does Implementing SOA Help?


i want an i.

RPG Modernization

2006 IBM Corporation

IBM System i

Traditional Programmers View of an Application


ALL001A *PGM
Work with Categories

ALL002A *PGM
Work with Products

PRODUCT

CATEGOR
ALL002B *PGM
Product Maintenance

STOCKMV

ALL003A *PGM
Prompt Categories

ALL004A *PGM
List Stock Movement

i want an i.

2006 IBM Corporation

IBM System i

Traditional Programmers View of a Program


Start
Process

Focussed on language
Code snippets
Translates into opcodes and variables

Display
Screen

Process

Read Screen
Process Result

Display
Screen

Access DB
Process

Process

Display
Screen

Display
Screen

Access DB
Process

Display
Screen

Print

Print

Access DB
Process

Print

RPG Modernization

Access DB
Process

Access DB
Process

i want an i.

Process
2006 IBM Corporation

IBM System i

Traditional Programmers View of an Application

i want an i.

2006 IBM Corporation

IBM System i

Traditional Business Process


Example: Order to Cash Process
Manual Steps

= business function
Marketing Application

Marketing

Order Mgmt Application

Fulfillment Application

Collections
Inventory Management

Business process is embedded in three separate applications

Processes may be repeated in different applications


Business functions are tightly coupled within applications

Single tier implementations (DSP, DB, logic etc intertwined in one program)
Business functions have unique and proprietary interfaces, restricting re-use
Process difficult to manage and adapt
Changes to the process are difficult to implement
New processes designed this way require long development cycles
Result: Business cannot operate on demand

i want an i.

RPG Modernization

2006 IBM Corporation

IBM System i

Step 1: Customer Self Service


Order entry

Customer

Division

Customers now order online using a web browser and the Internet

Business partners can order using a web service call from their own process

Customers are better served

Reduces requirement for additional staff to take more orders

i want an i.

2006 IBM Corporation

IBM System i

Step 2: Remove Redundant Code


Customer

Division
Shared
Services
Billing
Marketing

Common business functions are shared across the enterprise

Marketing, Billing, and Receivables are handled uniformly

Enterprise can scale across divisions and lower costs

i want an i.

RPG Modernization

Receivables

2006 IBM Corporation

IBM System i

Step 3: Just in Time Inventory


Customer

Division
Shared
Services
Supplier

Inventory Management

Minimize or eliminate inventory management function

Suppliers responsibility to ship when inventory gets low

Costs are reduced because less inventory is needed

Inventory servicing is better because of supplier integration with the process

i want an i.

2006 IBM Corporation

IBM System i

Step 4: Examine Viability and Off-Load as Required


Customer

Division
Shared
Services
Supplier

Outsourced
Shipping is not a core competency

Shipping companies (e.g. FedEx, DHL, UPS) have more capabilities

Reduce shipping infrastructure and overhead costs

Improve customer satisfaction - shipping/handling costs more accurate, maybe reduced

i want an i.

RPG Modernization

Shipping

2006 IBM Corporation

IBM System i

Step 5/On-going: Improve the Process


Customer

Remove
bottleneck

Division
Shared
Services
Supplier

Outsourced

Identify and remove bottlenecks in the process


Customize the business rules and policies to better serve customers
A more efficient business process costs less
Easier integration of new technology

i want an i.

Alternative flow
path

2006 IBM Corporation

IBM System i

Modernization of Applications and Data


1. Move to modern compilers
2. Modularize the code using
ILE
3. Replace components as
business dictates

RPG III,
COBOL/400
or CL/400

Java Bean

ILE
Srvpgm

RPG IV, ILE


COBOL or
ILE CL

Browser
Interface

RPG Modernization

Logic

Print

User
Interface DB

Stored
Procedures
DB triggers

Graphical
Interface

i want an i.

Java Bean

DB
constraints
2006 IBM Corporation

IBM System i

Modernization of Applications and Data


1. Move to modern compilers
2. Modularize the code using ILE
3. Replace components as business
dictates

RPG III,
COBOL/400
or CL/400

RPG IV, ILE


COBOL or
ILE CL

RPG

Procedures
Local variables
Integration with Java
Extended names, expanded
limits
Ability to work with XML files

COBOL
Call to procedures
Expanded limits
Ability to work with XML files
Current language standards
CL
New logic control
commands
Expanded number of files
supported
Variables

i want an i.

2006 IBM Corporation

IBM System i

Conversion to Modern Compilers


CVTRPGSRC RPG III syntax to RPG IV syntax

Converts to new specification layout


One conditioning indicator per line
Arrays converted to D-Specs
CODE/400 has the CVTRPGSRC option
Can view converted source prior to saving to the
server

COBOL/400 to ILE COBOL

Recompile as ILE COBOL


CL to ILE CL

Recompile as ILE CL

i want an i.

RPG Modernization

2006 IBM Corporation

IBM System i

A Word on Conversion
CVTRPGSRC only does a syntax conversion

y It will work almost 100%


y No logic flow changed
COBOL and CL re-compiles

y No logic flow changed


Third party conversion tools offer re-engineering:

Redefine data structures' fields by reordering them naturally,


converting from/to positions to actual lengths, and indenting
subfields.
Redefine *LIKE DEFN-defined fields in the D-specs.
Redefine C-spec-defined fields in the D-specs.
Redefine any of the ADD, SUB, MULT, DIV, Z-ADD, Z-SUB, MOVE,
MOVEL, etc. operations as free-form EVAL operations.
Convert Operation Codes to their free form equivalent.
Perform case conversion to either lower case or mixed case.

Third party and local conversion GREATLY increase the likelihood of testing
requirements.
Important to understand the tool and its conversion process

i want an i.

2006 IBM Corporation

IBM System i

Conversion Vendor Tools


The programs have already been converted to RPG IV.
Using the RPGWIZ conversion command in the RPG Toolbox
from Linoma Software.
Converted to Mixed Case.
Converted to Extended Factor 2.
Beware! You may not get the same results.

Field definitions moved to D Specs.


Using a local conversion program.
Added a copy directive for a standard H SPEC.

H Debug DatEdit(*MDY/) Option(*SrcStmt:*NoDebugIO)

i want an i.

RPG Modernization

2006 IBM Corporation

IBM System i

After Conversion - The Next Step

Start using BIFs.


BIFs offer powerful coding methods.
Prepare you for later techniques
Subprocedures writing your own BIFs.

Get rid of conditioning RPG Indicators (left and right)


No longer required.
Take the opportunity to make indicators self explanatory.

Use Prototyped Calls.


Have the compiler validate your parameters.
Get rid of parameter lists.
Make calls self documenting.

What about Free Form RPG?

i want an i.

2006 IBM Corporation

IBM System i

Modernization of Applications and Data


1. Move to modern compilers
2. Modularize the code using ILE
3. Replace components as business dictates

RPG III,
COBOL/400
or CL/400

RPG IV, ILE


COBOL or
ILE CL

Logic

Print

User
Interface DB

Modular Design
Code reuse
Improved quality of code
Maintenance
Less maintenance repetition
Easier to determine location of required changes
Compiles are faster?
Distribution of business function
Can distribute code as required

i want an i.

RPG Modernization

2006 IBM Corporation

10

IBM System i

Integrated Language Environment


JOB
OS/400

RPG
proc

CL
proc

C
proc

RPG
proc

RPG
proc

COBOL
proc

RPG
Pgm

ILE

RPG
Pgm

CL
Pgm

OPM

yDynamic or static binding


yOne environment integrates all ILE languages
both traditional and procedure based
yEnvironment provides run-time behaviour
yOPM still available
i want an i.

2006 IBM Corporation

Copyright IBM Corporation, 1999,2001

IBM System i

Binding: By Copy and By Reference


*SRVPGM S
*MODULE X
PRC X

*PGM A
*MODULE A
CALLB B

Multiple Call
Entry Points

*MODULE B
*MODULE Y

CALLPRC P2

RPG

PRC Y

CL

*MODULE Z

Bind by Copy

Bind by
Reference

PRC P1
PRC P2

yBoth are static (bound) calls


static calls are significantly faster than dynamic
yCompletion of reference bind on 1st call to *PGM A
dynamic bind to *SRVPGM S
then, all bound calls to 'S' are static
2006 IBM Corporation
i want an i.
Copyright IBM Corporation, 1999,2001

RPG Modernization

11

IBM System i

Service Programs
y*SRVPGM object type
yA collection of commonly used modules packaged together
yA kind of "subroutine library"
yUses fast static call - static bind by reference
yCannot be called dynamically
yMultiple entry points
CL
Source
X

CRTCLMOD

RPG
Source
Y

CRTRPGMOD

C
Source
Z

*MODULE X
*MODULE X
PRC X

*MODULE Y
PRC Y

CRTCMOD

*MODULE Z
PRC P1
PRC P2

i want an i.

PRC X
CRTSRVPGM...
MOD(X Y Z)

*MODULE Y
PRC Y

*MODULE Z
PRC P1
PRC P2
2006 IBM Corporation

Copyright IBM Corporation, 1999,2001

IBM System i

RPG IV Subprocedures
This is the RPG IV name for a User-Defined Procedure or BIF
Subprocedures can:
yDefine their own local variables
This provides for "safer" development since only the code
associated with the variable can change its content
yAccess Global variables
Those defined in the main body of the source
This includes access to any files defined in the program
yBe called recursively
The Compilation Unit can have any number of subprocedures
yEach must have its own prototype
By "Compilation Unit" we mean those source lines processed by
the compiler in a single compilation
yThis includes any /COPY members

i want an i.

RPG Modernization

2006 IBM Corporation

12

IBM System i

Taking Inventory
Impact Analysis
Structure Charts
Data Flows
Data Modelling
Pseudo Code
Word & Visio Export
Business Rules
Drill-down Inquiry

REDP4046 - Modernizing and Improving the


Maintainability of RPG Applications Using X-Analysis
Version 5.6

i want an i.

2006 IBM Corporation

IBM System i

Modernization of Applications and Data


1. Move to modern compilers
2. Modularize the code using ILE
3. Replace components as business dictates
User interface Web GUI, Rich client

RPG III,
COBOL/400
or CL/400

RPG IV, ILE


COBOL or
ILE CL

Graphical
Interface
Browser
Interface

i want an i.

RPG Modernization

Logic

Print

User
Interface DB

ReFacing
Translation of data stream
Re-direction
Alternate interface with redirect intercept
Crafting of new
CGI-bin
Java JSP, JSP, rich client
2006 IBM Corporation

13

IBM System i

CGI - Bin Programs


Open connection,
send request w/ parms

Web browser

HTTP
server

Send page with parms,


close connection

TCP/IP

HTML &
images
CGI-Bin
programs
Net.Data

yOriginal way to create interactive HTML pages


yCan get input from many sources:
yURL and data entered on an HTML <FORM>
are supplied as environment variables.
yDB2/400, other programs, etc.

IFS
QSYS.LIB

yCan be written in any of many languages


including RPG !
yMore proprietary, not as scalable

DB2/400

i want an i.

Macros
SQL
C, CL, RPG,
COBOL, Java,
REXX

2006 IBM Corporation

IBM System i

Re-Direction of User Interface


Traditional
Model

*PGM
User Interface
Logic

DDS

Data
Buffer

Display
File (DSPF)

Time:8:05

date:Oct 22,2000

enter customer number:_____

Enter

Business Logic
Conversion
done during
development

DB Logic
Web
Model

Data
Buffer

5250 screens

Graphical Objects

Server ?

Browser

i want an i.

RPG Modernization

2006 IBM Corporation

14

IBM System i

Telnet Converter Architecture


Time:8:05

*PGM
User Interface
Logic

Data
Buffer

Display File
Objects

date:Oct 22,2000

enter customer number:_____

Enter

Business Logic
5250 screens

DB Logic
Transformation
Engine

Java
Components

Development
Tool

Application
Server ?

Browser

i want an i.

2006 IBM Corporation

IBM System i

Java Applets
Open connection,
request page (URL)
Send page,
close connection

Web browser,
Java virtual
machine

HTTP
server

HTML &
images,
Applets

HTTP / TCP communications

yHTML page requests a Java applet


yMost recent version of the applet is downloaded from server it's if not
already local
yJava applet can now do anything, including interacting with the server (IBM
Java Toolbox)

i want an i.

RPG Modernization

2006 IBM Corporation

15

IBM System i

Rich Client

HTTP / TCP
communications

Desktop Client
GUI
Communication code
Business logic

HTTP
server

Application
Server ?

Server Application
Communication code
Business logic
Data Access
Printing

i want an i.

2006 IBM Corporation

IBM System i

Modernization of Applications and Data


1. Move to modern compilers
2. Modularize the code using ILE
3. Replace components as business dictates
User interface Web GUI, Rich client
Database

RPG III,
COBOL/400
or CL/400

RPG IV, ILE


COBOL or
ILE CL

Browser
Interface

RPG Modernization

Logic

Print

User
Interface DB

Stored
Procedures
DB triggers

Graphical
Interface

i want an i.

SQL
Data Definition
Data Manipulation
Advanced Functions
Referential Integrity
Triggers
Stored Procedures
Check Constraints
Remote Database Access

DB
constraints
2006 IBM Corporation

16

IBM System i

What is Referential Integrity?

Delete request
Delete denied

DB2 UDB for System i


Customer
file

Invoices

4711
4711

Parent
file

Constraint
s

Enforce
constraint

4711
Dependent
file

yA capability provided by the database management system to ensure


logical consistency of data values between files
validity of data relationships
robust enforcement of integrity constraints

i want an i.

2006 IBM Corporation

IBM System i

Check Constraints
What are they?

NEW DATA

RANGE CHECKING
... BETWEEN 0 AND 100

DOMAIN VALIDATION
... IN (IA,NY,CA)

DATA FILTER
(Business Rules)

Valid Data
New Row

FIELD COMPARISONS
... ORDER < INVENTORY

i want an i.

RPG Modernization

2006 IBM Corporation

17

IBM System i

Triggers: An Example

DB2 UDB for System i


4711
5436

SENDFAX
program

4711

yWhen a new order is inserted, a trigger is fired


yTrigger retrieves information about order and
customer
yA confirmation fax is automatically sent
i want an i.

2006 IBM Corporation

IBM System i

Modernization of Applications and Data


1. Move to modern compilers
2. Modularize the code using ILE
Java Bean
3. Replace components as business dictates
User interface Web GUI, Rich client
Database
ILE
Business Logic
Srvpgm
Local components

RPG III,
COBOL/400
or CL/400
Integration with Java
JNI
Java toolbox
Integration with ILE modules
CALLP
CALLB
APIs

i want an i.

RPG Modernization

RPG IV, ILE


COBOL or
ILE CL

Graphical
Interface
Browser
Interface

Logic

Print

User
Interface DB

Stored
Procedures
DB triggers
DB
constraints
2006 IBM Corporation

18

IBM System i

Integration of Business Logic


WMQ
IBM Toolbox for Java
Java sockets code

Socket / Queue
User
interface
code

Router
Call
Pgm / Srv Pgm

Program Call

Pgm / Srv Pgm

Tightly coupled
Fixed max length input/output
parameters
JDBC
Easy to implement

Pgm / Srv Pgm


Stored Procedures

Messaging

Loosely coupled
Unknown length parameters
Flexibility
Cross Program/ Cross Application

System i5
Applications

i want an i.

2006 IBM Corporation

IBM System i

Implement- Leverage / Wrapper interfaces

Socket / Queue
WMQ
IBM Toolbox for Java
Java sockets code

Router

User
interface
code

Call
Pgm / Srv Pgm
Pgm / Srv Pgm
Pgm / Srv Pgm

Web Services

Business functions available over a


network

JDBC
Stored Procedures

Java Message Service (JMS)

Standard way for Java to write to messaging


products

J2EE Connector Architecture (JCA)

WebSphere Business Integration (WBI)

System i5
Applications

J2EE standard for connecting to legacy

i want an i.

RPG Modernization

2006 IBM Corporation

19

IBM System i

Modernization of Applications and Data


1. Move to modern compilers
2. Modularize the code using ILE
Java Bean
3. Replace components as business dictates
User interface Web GUI, Rich client
Database
ILE
Business Logic
Srvpgm
Local components
Remote components

RPG III,
COBOL/400
or CL/400

RPG IV, ILE


COBOL or
ILE CL

Logic

Java Bean

Print

User
Interface DB

Web Services
Java
RPG, COBOL
Graphical
Other
Interface
XML
Browser
Transfer of data
Interface
Transaction Processing

i want an i.

Stored
Procedures
DB triggers
DB
constraints
2006 IBM Corporation

IBM System i

Integration of Applications
Problem:
Integrating software applications across multiple operating systems, programming
languages, and hardware platforms is
Difficult
Not something that can be solved by any one particular proprietary environment

Traditionally, the problem has been one of tight-coupling


One application that calls a remote network is tied strongly to it by the function call it
makes and the parameters it requests
Fixed interface to access remote programs or data, with little flexibility or adaptability
to changing environments or needs

Web services technology allows applications to communicate in a platform, and


programming language independent manner

Solutions:
Web Services
Other XML
Other Solutions

i want an i.

RPG Modernization

2006 IBM Corporation

20

IBM System i

What are Web Services?


Web services are self-contained software components, with a welldefined interface
Extensible Markup Language (XML) is a standardized language used
for interface description
Web services use protocols based on XML to describe

operations that can be executed


data that can be exchanged with other programs or web
services

i want an i.

2006 IBM Corporation

IBM System i

Overview With System i


Client logic simply
invokes the proxy
and does not
know the Web
service is remote

Java wrapper for RPG / COBOL program


(generated from Program Call Wizard)

WAS
Business
Logic
Component
(RPG or
COBOL)

Business logic
does not know it
is begin invoked
as a Web service

i want an i.

RPG Modernization

TCP/IP Network
SOAP over HTTP

Client
application /
B2B app

Web Service Client Proxy


(generated code)

Web Service Wrapper


(generated code)

2006 IBM Corporation

21

IBM System i

RPG Calling Web Services

Thin Java wrapper to read


request from data queue, invoke
the client proxy, and write results
back to the data queue

WAS
SOAP over HTTP

DataQ

TCP/IP Network

Some Web
service

Thin
Java
Wrapper

Thin
Java
wrapper

RPG/
COBOL
program

RPG program writes


request and
input data for Web
service on to
the data queue and
reads the results

Web Service Client Proxy


(generated code)

i want an i.

2006 IBM Corporation

IBM System i

SOA in a Box??
Order
Commerce

Processing

Warehouse

Customer
Service

Linux
Firewall

WebSphere
Commerce

Apache
HTTP
Server

RPG Order
Entry
System
(Take order
via Web)

C++ Order
Fulfillment
System
(Fulfill
order)

MQ Fulfill

Visual Basic
Order
Acknowledge
ment System
(acknowledge
order)

WBI Acknowledge

WBI Order
Forward

e-mail customer
MQ Confirm
MQ GL entries

HQ
Accounting

POWER
POWER Hypervisor
Hypervisor

i want an i.

RPG Modernization

2006 IBM Corporation

22

IBM System i

Summary
1. Move to modern compilers
2. Modularize the code using ILE
3. Replace components as
business dictates

RPG III,
COBOL/400
or CL/400

Java Bean

Java Bean

ILE
Srvpgm

RPG IV, ILE


COBOL or
ILE CL

Logic

Print

User
Interface DB

Stored
Procedures
DB triggers

Graphical
Interface
Browser
Interface

DB
constraints

i want an i.

2006 IBM Corporation

IBM System i

Trademarks & Disclaimers


8 IBM Corporation 1994-2005. All rights reserved.
References in this document to IBM products or services do not imply that IBM intends to make them available in every country.
The following terms are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries, or both:
AS/400

IBM(logo)

AS/400e

iSeries

e (logo) business

OS/400

IBM
Lotus, Freelance Graphics, and Word Pro are registered trademarks of Lotus Development Corporation and/or IBM Corporation.
Domino is a trademark of Lotus Development Corporation and/or IBM Corporation.
C-bus is a trademark of Corollary, Inc. in the United States, other countries, or both.
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in the United States, other countries, or both.
ActionMedia, LANDesk, MMX, Pentium and ProShare are trademarks of Intel Corporation in the United States, other countries, or both.
UNIX is a registered trademark of The Open Group in the United States and other countries.
SET and the SET Logo are trademarks owned by SET Secure Electronic Transaction LLC.
Other company, product and service names may be trademarks or service marks of others.
Information is provided "AS IS" without warranty of any kind.
All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs and
performance characteristics may vary by customer.
Information in this presentation concerning non-IBM products was obtained from a supplier of these products, published announcement material, or other publicly available sources and does not
constitute an endorsement of such products by IBM. Sources for non-IBM list prices and performance numbers are taken from publicly available information, including vendor announcements and
vendor worldwide homepages. IBM has not tested these products and cannot confirm the accuracy of performance, capability, or any other claims related to non-IBM products. Questions on the
capability of non-IBM products should be addressed to the supplier of those products.
All statements regarding IBM future direction and intent are subject to change or withdrawal without notice, and represent goals and objectives only. Contact your local IBM office or IBM authorized
reseller for the full text of the specific Statement of Direction.
Some information in this presentation addresses anticipated future capabilities. Such information is not intended as a definitive statement of a commitment to specific levels of performance, function
or delivery schedules with respect to any future products. Such commitments are only made in IBM product announcements. The information is presented here to communicate IBM's current
investment and development activities as a good faith effort to help with our customers' future planning.
Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary
depending upon considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no
assurance can be given that an individual user will achieve throughput or performance improvements equivalent to the ratios stated here.
Photographs shown are of engineering prototypes. Changes may be incorporated in production models.

i want an i.

RPG Modernization

2006 IBM Corporation

23

Potrebbero piacerti anche