Download presentation
Presentation is loading. Please wait.
Published byFlora Garrison Modified over 9 years ago
1
© Logicalis Group ILE and RPG IV Logicalis Briefing, 9 September 2005
2
Green screen 5250 Display file RPG or COBOL program Physical or logical file DB2/400 Interface Presentation and navigation Transport Application logic Interface to data store Database Web browser WebFacing and/or HATS Struts/JSF Entity bean Session bean Connectors JDBC, MQ, etc. Web service, e.g. for.Net coexistence Embedded SQL An iSeries developer’s roadmap
3
Another view RPG IV RPG III ILE SEU/PDM/SDA Remote Systems Explorer Java DDS Separate presentation from logic (HTML/GUI) Native database access SQL WDSC J2EE IDE Support, maintainability and reuse Change control and deployment techniques Performance Open standards Debugging Batch FTP, custom formats Assured delivery messaging, message transformation, XML Program-to- program calls Open standards component interaction
4
RPG IV and the Integrated Language Environment RPG IV Functionality Syntax Why ILE? Flexibility Performance Ease-of-use
5
RPG/IV Highlights Specification layout changes (no L or E specs) New D(efinition) spec Expanded names - underscore allowed - 10 chars Upper/lower case source equivalency Free-form Maths & logical expressions Date, Timestamp support Pointer support Most limits raised or removed You have to convert - not source compatible Migration process is straightforward (CVTRPGSRC)
6
RPG/IV Examples DQCUSTCDT C 'QCUSTCDT' DPROCDS DS D PTR1 * PROCPTR INZ(%PADDR(QCUSTCDT)) D PROCS 1 1600* PROCPTR DIM(100) DFILEDS DS D FIL1 10A INZ(QCUSTCDT) D FILES 1 1000A DIM(100) DPROC S * PROCPTR C FILE LOOKUP FILES(X) 50 C MOVE *NULL PROC C RETURN If (A > 10 AND *IN02) EVAL Salary = Salary * 1.25 Endif DOU CowsComHom = '1' Exsr MovCows Eval CowsComHom = (CowsInFld = 0 AND CowsEnRte = 0) EndDo IF NeedName Eval(P) WholeName = FirstName + ' ' + LastName + '.' EndIf DName DS BASED(Ptr) D FirstName D Lastname DARRA S 10 DIM(10)
7
ILE benefits Original Program Model (OPM) Single entry point Single variable scope, no pointer support One program = one compilation Dynamic program-to-program calls with performance overhead Integrated Language Environment (ILE) Modular programming with good performance No need for dynamic program-to-program calls Mix programming languages without performance overhead C, C++, COBOL, RPG, CL Code re-use, multiple entry points Nested variable scope, pointer support Faster compilations
8
ILE example PTSTSOCKET HOST(PACIFIC6) PORT(1352) If successful, a completion message will be returned Connection successfully obtained to PACIFIC6 on port 1352 Otherwise, an appropriate escape message will be returned Host CAT32 name resolved but no connection was possible on port 1352
9
Invocation: dynamic (external) versus bound (internal) Program A Program A subroutine calls another subroutine in same program: INTERNAL CALL Program B Program C SUB1 SUB2 Program B calls Program C EXTERNAL CALL
10
Structure of a simple ILE program Procedure CRTINVNBR Procedure DATEHANDLE RPGMOD1 Module MOD1 Module MOD3 Program INVMAST CBLMOD1 Module MOD2 Programs *PGM object. OPM via CRTxxxPGM, ILE via CRTPGM *PGMs contain 1 or more modules Modules *MODULE object type Contains translated but unexecutable code Must be BOUND into a program to run Input is a source member May contain one or more procedures Procedures Executable code with entry point Not an AS/400 object RPG & Cobol: 1 per compilation, C: many per compilation Appear on CALL stack
11
Binding Procedure CRTINVNBR Procedure DATEHANDLE Module RPGMOD1 Module CMOD3 Module CBLMOD2 Program INVMAST Module RPGMOD1 Module CBLMOD2 Module CMOD3 Procedure CRTINVNBR Procedure DATEHANDLE CRTPGM INVMAST MOD(RPGMOD1 + CBLMOD2 + CMOD3) Cobol SRCMBR CBLMOD2 RPG SRCMBR RPGMOD1 C SRCMBR CMOD3 CRTRPGMOD CRTCBLMOD CRTCMOD CALLB CBLMOD2 CALL LINK CMOD3 PROC CRTINVNBR Program INVMAST is statically bound by copy
12
Service programs Procedure CRTINVNBR Procedure DATEHANDLE Module MODX Module CMOD3 Module MODY *SRVPGM SRV1 Module MODX Module MODY Module CMOD3 Procedure CRTINVNBR Procedure DATEHANDLE CRTSRVPGM + SRV1 + MOD(MODX + MODY + CMOD3) Cobol SRCMBR MODY RPG SRCMBR MODX C SRCMBR CMOD3 CRTRPGMOD CRTCBLMOD CRTCMOD Service program is analogous to subroutine library or DLL
13
Activation groups Menu FILEX INV1INV2INV3 ActGrp INV FILEX OE1OE2OE3 ActGrp OE Default Group OPM Pgm
14
Activation groups Applications can be separated more cleanly at run time Activation groups own resources such as ODPs, Commit Scope, exception handlers and SQL cursors but not Overrides A default activation group created for OPM and IBM code CRTPGM and CRTSRVPGM commands specify activation groups: By name *CALLER *NEW Requires some design thought, especially if exception handling is used and if OPM and ILE programs are mixed Watch out for third party usage!
15
Hints and tips Don’t go overboard … Change control and regression testing impact
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.