09112006horpgtosoaab
DESCRIPTION
SOATRANSCRIPT
-
RPG Modernization 1
2006 IBM Corporation
i want stress-free IT.i want control.
i want an i.
IBM System i
Simplify IT
Alison [email protected]
Moving RPG to an SOA Framework; A Step by Step Overview
IBM System i
2006 IBM Corporationi want an 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.
-
RPG Modernization 2
IBM System i
2006 IBM Corporationi want an i.
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
Why SOA?
Does this sound like applications in your shop?
Does Implementing SOA Help?
IBM System i
2006 IBM Corporationi want an i.
The interface is changing.yThe preference is for GUI as opposed to green screen.yIntegration with new architectures requires modular code
The ChoicesyGet new applications.yModernize current applications.
ConsiderationsyProtect 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.
Why Modernize?
Does Implementing SOA Help?
-
RPG Modernization 3
IBM System i
2006 IBM Corporationi want an i.
ALL003A *PGMPrompt Categories
ALL002B *PGMProduct Maintenance
ALL002A *PGMWork with Products
ALL001A *PGMWork with Categories
CATEGOR
ALL004A *PGMList Stock Movement
STOCKMV
PRODUCT
Traditional Programmers View of an Application
IBM System i
2006 IBM Corporationi want an i.
Traditional Programmers View of a Program
??
?
?
Display Screen
Display Screen
Display Screen
Display Screen
Display Screen
Start
Read ScreenProcess Result
Process
Access DBProcess
Access DBProcess
Access DBProcess
Access DBProcess
Access DBProcess
Process
Process
Print
Print
Print
Process
Focussed on languageCode snippetsTranslates into opcodes and variables
-
RPG Modernization 4
IBM System i
2006 IBM Corporationi want an i.
Traditional Programmers View of an Application
IBM System i
2006 IBM Corporationi want an i.
Traditional Business ProcessExample: Order to Cash Process
= business function
MarketingInventory Management
Collections
Marketing Application
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
Order Mgmt Application Fulfillment Application
Manual Steps
-
RPG Modernization 5
IBM System i
2006 IBM Corporationi want an i.
Customer
Division
Step 1: Customer Self ServiceOrder entry
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
IBM System i
2006 IBM Corporationi want an i.
Step 2: Remove Redundant Code
SharedServices
Customer
Division
MarketingBilling
Receivables
Common business functions are shared across the enterprise Marketing, Billing, and Receivables are handled uniformly Enterprise can scale across divisions and lower costs
-
RPG Modernization 6
IBM System i
2006 IBM Corporationi want an i.
Step 3: Just in Time Inventory
Supplier
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
Inventory Management
SharedServices
Customer
Division
IBM System i
2006 IBM Corporationi want an i.
Step 4: Examine Viability and Off-Load as Required
Outsourced
Supplier
SharedServices
Customer
Division
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
Shipping
-
RPG Modernization 7
IBM System i
2006 IBM Corporationi want an i.
Step 5/On-going: Improve the Process
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
Outsourced
Supplier
SharedServices
Customer
Division
Removebottleneck
Alternative flow path
IBM System i
2006 IBM Corporationi want an i.
Modernization of Applications and Data
RPG IV, ILE COBOL or ILE CL
Print
User Interface DB
LogicRPG III, COBOL/400 or CL/400
DB constraints
DB triggers
Stored ProceduresGraphical
InterfaceBrowser Interface
ILE Srvpgm
Java BeanJava Bean1. Move to modern compilers2. Modularize the code using
ILE3. Replace components as
business dictates
-
RPG Modernization 8
IBM System i
2006 IBM Corporationi want an i.
Modernization of Applications and Data
RPG IV, ILE COBOL or ILE CL
RPG III, COBOL/400 or CL/400
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
1. Move to modern compilers2. Modularize the code using ILE3. Replace components as business
dictates
IBM System i
2006 IBM Corporationi want an 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
-
RPG Modernization 9
IBM System i
2006 IBM Corporationi want an i.
A Word on ConversionCVTRPGSRC only does a syntax conversion
y It will work almost 100%y No logic flow changed
COBOL and CL re-compilesy 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
IBM System i
2006 IBM Corporationi want an 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)
-
RPG Modernization 10
IBM System i
2006 IBM Corporationi want an 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?
IBM System i
2006 IBM Corporationi want an i.
Modernization of Applications and Data
RPG IV, ILE COBOL or ILE CL
Print
User Interface DB
LogicRPG III, COBOL/400 or CL/400
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
1. Move to modern compilers2. Modularize the code using ILE3. Replace components as business dictates
-
RPG Modernization 11
IBM System i
2006 IBM Corporationi want an i. Copyright IBM Corporation, 1999,2001
Integrated Language Environment
OS/400
RPG Pgm
RPG Pgm CL
PgmRPG proc
RPG proc
CL proc
C proc
RPG proc
COBOL proc
JOB
OPMILE
yDynamic or static bindingyOne environment integrates all ILE languages
both traditional and procedure based yEnvironment provides run-time behaviouryOPM still available
IBM System i
2006 IBM Corporationi want an i. Copyright IBM Corporation, 1999,2001
Binding: By Copy and By Reference
*MODULE X
PRC X
*MODULE Y
PRC Y
*MODULE Z
PRC P1PRC P2
CALLB B
*SRVPGM S
*MODULE A
CALLPRC P2
RPG CL
Bind by Reference
Bind by Copy
*MODULE B
Multiple Call Entry Points
yBoth are static (bound) callsstatic calls are significantly faster than dynamicyCompletion of reference bind on 1st call to *PGM A
dynamic bind to *SRVPGM Sthen, all bound calls to 'S' are static
*PGM A
-
RPG Modernization 12
IBM System i
2006 IBM Corporationi want an i. Copyright IBM Corporation, 1999,2001
Service Programs
CRTSRVPGM...MOD(X Y Z)
CLSourceX
CRTCLMOD
RPGSourceY
CRTRPGMOD
CSource Z
CRTCMOD
PRC P1PRC P2
*MODULE X
PRC X
*MODULE Y
PRC Y
*MODULE X
PRC X
*MODULE Y
PRC Y
*MODULE Z
PRC P1PRC P2
*MODULE Z
y*SRVPGM object typeyA collection of commonly used modules packaged togetheryA kind of "subroutine library"yUses fast static call - static bind by referenceyCannot be called dynamicallyyMultiple entry points
IBM System i
2006 IBM Corporationi want an i.
This is the RPG IV name for a User-Defined Procedure or BIFSubprocedures 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 variablesThose defined in the main body of the sourceThis includes access to any files defined in the programyBe called recursively
The Compilation Unit can have any number of subproceduresyEach must have its own prototype
By "Compilation Unit" we mean those source lines processed by the compiler in a single compilationyThis includes any /COPY members
RPG IV Subprocedures
-
RPG Modernization 13
IBM System i
2006 IBM Corporationi want an 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
IBM System i
2006 IBM Corporationi want an i.
Modernization of Applications and Data
RPG IV, ILE COBOL or ILE CL
Print
User Interface DB
LogicRPG III, COBOL/400 or CL/400
Graphical Interface
Browser Interface
ReFacing Translation of data streamRe-direction Alternate interface with re-
direct interceptCrafting of new CGI-bin Java JSP, JSP, rich client
1. Move to modern compilers2. Modularize the code using ILE3. Replace components as business dictates
User interface Web GUI, Rich client
-
RPG Modernization 14
IBM System i
2006 IBM Corporationi want an i.
CGI-Binprograms
CGI - Bin Programs
Web browser
HTML &imagesHTTP
server
Open connection, send request w/ parms
Send page with parms, close connection
yOriginal way to create interactive HTML pagesyCan get input from many sources:yURL and data entered on an HTML are supplied as environment variables.yDB2/400, other programs, etc.
yCan be written in any of many languages including RPG !yMore proprietary, not as scalable
C, CL, RPG, COBOL, Java,
REXXDB2/400
IFSQSYS.LIB SQL
TCP/IPNet.Data
Macros
IBM System i
2006 IBM Corporationi want an i.
Re-Direction of User Interface
DataBuffer
DataBuffer
enter customer number:_____
Time:8:05 date:Oct 22,2000
Enter
TraditionalModel
5250 screens
Business Logic
DB Logic
User InterfaceLogic
*PGM
Browser
WebModel
DisplayFile (DSPF)
DDS
Graphical Objects
Server ?
Conversion done during development
-
RPG Modernization 15
IBM System i
2006 IBM Corporationi want an i.
Telnet Converter Architecture
Java Components
DataBuffer
enter customer number:_____
Time:8:05 date:Oct 22,2000
Enter
5250 screens
Business Logic
DB Logic
User InterfaceLogic
*PGM
Browser
Display File Objects
Development Tool
Application Server ?
Transformation Engine
IBM System i
2006 IBM Corporationi want an i.
Java Applets
Web browser,Java virtual
machine
HTML &images,Applets
Open connection,request page (URL)
Send page, close connection
HTTP / TCP communications
yHTML page requests a Java appletyMost recent version of the applet is downloaded from server it's if not already localyJava applet can now do anything, including interacting with the server (IBM Java Toolbox)
HTTPserver
-
RPG Modernization 16
IBM System i
2006 IBM Corporationi want an i.
Rich Client
HTTPserver
HTTP / TCP communications
Server ApplicationCommunication codeBusiness logicData AccessPrinting
Desktop ClientGUICommunication codeBusiness logic
Application Server ?
IBM System i
2006 IBM Corporationi want an i.
Modernization of Applications and Data
RPG IV, ILE COBOL or ILE CL
Print
User Interface DB
LogicRPG III, COBOL/400 or CL/400
DB constraints
DB triggers
Stored ProceduresGraphical
InterfaceBrowser Interface
SQL Data Definition Data Manipulation
Advanced Functions Referential Integrity Triggers Stored Procedures Check Constraints Remote Database Access
1. Move to modern compilers2. Modularize the code using ILE3. Replace components as business dictates
User interface Web GUI, Rich client Database
-
RPG Modernization 17
IBM System i
2006 IBM Corporationi want an i.
What is Referential Integrity?
yA capability provided by the database management system to ensurelogical consistency of data values between filesvalidity of data relationshipsrobust enforcement of integrity constraints
4711
47114711
Parent file
Dependent file
Customer file
Invoices
Constraints
Enforce constraint
DB2 UDB for System i
Delete request
Delete denied
IBM System i
2006 IBM Corporationi want an i.
DATA FILTERDATA FILTER(Business Rules)(Business Rules)
NEW DATA
Valid DataNew Row
RANGE CHECKING... BETWEEN 0 AND 100
FIELD COMPARISONS... ORDER < INVENTORY
DOMAIN VALIDATION... IN (IA,NY,CA)
Check ConstraintsWhat are they?
-
RPG Modernization 18
IBM System i
2006 IBM Corporationi want an i.
Triggers: An Example
5436
DB2 UDB for System i
4711
4711
SENDFAX program
yWhen a new order is inserted, a trigger is firedyTrigger retrieves information about order and customeryA confirmation fax is automatically sent
IBM System i
2006 IBM Corporationi want an i.
Modernization of Applications and Data
RPG IV, ILE COBOL or ILE CL
Print
User Interface DB
LogicRPG III, COBOL/400 or CL/400
DB constraints
DB triggers
Stored Procedures
Graphical Interface
Browser Interface
ILE Srvpgm
Java Bean
Integration with Java JNI Java toolbox
Integration with ILE modules CALLP CALLB APIs
1. Move to modern compilers2. Modularize the code using ILE3. Replace components as business dictates
User interface Web GUI, Rich client Database Business Logic
Local components
-
RPG Modernization 19
IBM System i
2006 IBM Corporationi want an i.
Integration of Business Logic
WMQIBM Toolbox for JavaJava sockets code
Program Call Tightly coupled Fixed max length input/output
parameters Easy to implement
Messaging Loosely coupled Unknown length parameters Flexibility Cross Program/ Cross Application
Pgm / Srv Pgm
Call
Socket / Queue
Router
User interface
code
Stored ProceduresJDBC
Pgm / Srv Pgm
Pgm / Srv Pgm
System i5 Applications
IBM System i
2006 IBM Corporationi want an i.
Implement- Leverage / Wrapper interfaces
Web Services Business functions available over a
network Java Message Service (JMS)
Standard way for Java to write to messaging products
J2EE Connector Architecture (JCA) J2EE standard for connecting to legacy
WebSphere Business Integration (WBI)
Pgm / Srv Pgm
Call
Socket / Queue
Router
User interface
code
System i5 Applications
Stored ProceduresJDBC
Pgm / Srv Pgm
Pgm / Srv Pgm
WMQIBM Toolbox for JavaJava sockets code
-
RPG Modernization 20
IBM System i
2006 IBM Corporationi want an i.
Modernization of Applications and Data
RPG IV, ILE COBOL or ILE CL
Print
User Interface DB
LogicRPG III, COBOL/400 or CL/400
DB constraints
DB triggers
Stored ProceduresGraphical
InterfaceBrowser Interface
Java Bean
Web Services Java RPG, COBOL Other
XML Transfer of data
Transaction Processing
1. Move to modern compilers2. Modularize the code using ILE3. Replace components as business dictates
User interface Web GUI, Rich client Database Business Logic
Local components Remote components
ILE Srvpgm
Java Bean
IBM System i
2006 IBM Corporationi want an i.
Integration of Applications
Web Services Other XML Other Solutions
Solutions:
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
Problem:
-
RPG Modernization 21
IBM System i
2006 IBM Corporationi want an i.
What are Web Services?
Web services are self-contained software components, with a well-defined interface
Extensible Markup Language (XML) is a standardized language usedfor 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
IBM System i
2006 IBM Corporationi want an i.
Overview With System i
BusinessLogic
Component(RPG orCOBOL)
Web Service Wrapper(generated code)
Clientapplication /
B2B app
Web Service Client Proxy(generated code)
TCP/IP Network
SOAP over HTTP
Java wrapper for RPG / COBOL program(generated from Program Call Wizard)
Business logicdoes not know it is begin invoked as a Web service
Client logic simply invokes the proxy
and does not know the Web
service is remote
WAS
-
RPG Modernization 22
IBM System i
2006 IBM Corporationi want an i.
RPG Calling Web Services
Some Webservice
ThinJava
wrapper
TCP/IP Network
SOAP over HTTP
Thin Java wrapper to read request from data queue, invoke the client proxy, and write results
back to the data queue
RPG/COBOLprogram
WASThin Java
WrapperD
ataQ
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)
IBM System i
2006 IBM Corporationi want an i.
SOA in a Box??
Linux
Firewall
Apache HTTP Server
C++ Order Fulfillment
System (Fulfill order)
POWER HypervisorPOWER Hypervisor
RPG Order Entry
System (Take order
via Web)
Visual Basic Order
Acknowledgement System(acknowledge
order)MQ FulfillWBI Acknowledge
MQ Confirm
e-mail customer
MQ GL entries
WarehouseOrder
ProcessingCustomer Service
HQ Accounting
WebSphere Commerce
WBI Order Forward
Commerce
-
RPG Modernization 23
IBM System i
2006 IBM Corporationi want an i.
Summary
RPG IV, ILE COBOL or ILE CL
Print
User Interface DB
LogicRPG III, COBOL/400 or CL/400
DB constraints
DB triggers
Stored ProceduresGraphical
InterfaceBrowser Interface
ILE Srvpgm
Java BeanJava Bean1. Move to modern compilers2. Modularize the code using ILE3. Replace components as
business dictates
IBM System i
2006 IBM Corporationi want an i.
Trademarks & Disclaimers8 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:
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.
AS/400 IBM(logo)AS/400e iSeriese (logo) business OS/400IBM