160 likes | 384 Views
RPG-ILE Maximum Speed New Development Approach. Presented by: Robert Arce. File (physical and logicals) Services (I, V, B, U) WX00010B WX00010I WX00010U WX00010V Programs use data from the file ONLY by using the services. File driven Services.
E N D
RPG-ILE Maximum SpeedNew Development Approach Presented by: Robert Arce Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
File (physical and logicals) Services (I, V, B, U) WX00010B WX00010I WX00010U WX00010V Programs use data from the file ONLY by using the services File driven Services Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
XX = Identifies the application Id. For instance: OE nnnnn = consecutive number of 5 positions Z = type of object XXnnnnnZ objects Naming Conventions Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
Files ‘M’=Master File ‘T’ =Transaction File ‘W’=Work File ‘F’ =Report Format File ‘D’=Display File ‘A’=Audit Trail Logical=suffix L and a consecutive character (1..9 or A..Z) Other: ‘DA’=Data Area ‘DQ’=Data Queue Z = Object Type Naming Conventions Programs • ‘R’=RPG ‘C’=CL • ‘V’=Service Program • ‘I’=Procedure Prototype Interface Definition (copy) • ‘B’=Binding source • ‘U’=Unit test program • ‘P’ = C or C++ Processes • ‘Q’=Query • ‘S’=SQL program Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
Add record Delete record Updates ... (specific fields) Gets ... (specific fields) ReadNext (for loops, different sorts, selections) File Services Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
Helps to manage signatures avoiding having to recompile every program that uses a service when adding more procedures or function to existing service program, changing code. If parameters or function names are modified you will have to recompile every program that uses the modified service program. Binding Source Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
STRPGMEXP PGMLVL(*CURRENT) LVLCHK(*YES) EXPORT SYMBOL(AddPickLine) EXPORT SYMBOL(DltPickLine) EXPORT SYMBOL(UpdOvrPickQty) ENDPGMEXP --------------------------------------- STRPGMEXP PGMLVL(*PRV) LVLCHK(*YES) EXPORT SYMBOL(AddPickLine) ENDPGMEXP Binding Source Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
Describes the interface of the service programs and it is use as a copy book in every program that needs to use the service program. Compiler uses it to verify that all the parameters match the actual definition of the service (prototype vs procedure interface). Prototype Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
Contains the code that implements the functions or procedures. Uses the ‘I” source as the copy book. Defines global variables. Has the file definition. Only the primary file is set to update and add. Any other files (logicals) are defined as Input only. Describes how to create the object by using the Binding source. Implements the function and procedures. Defines the Procedure Interface. Service Program Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
A good convention is to create one binding directory per subsystem. For instance: OEBNDDIR (Order Entry binding directory) Binding directories should be included in the H form as the compiler directory. For instance: H DftActGrp(*NO) ActGrp(*NEW) BndDir(‘OEBNDDIR':‘ARBNDDIR') Binding Directory Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
Program created to test the services within the service program. Uses the ‘I’ source as the copy book. Is very handy when changes are made to the service program or to place test data. As a convention all the services need to be call by using a case statement and a subroutine per each procedure or function. Unit Program Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
To avoid using use of PLIST’s in programs you need to create an Interface source. Advantages: Parameters are match at compilation time instead of at run time. Actual input parameters (value and constant). Easier to call programs passing constants if the parameters are input only. NO PLIST - Prototype (‘I’) Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
*Object : WX00001I *Created by : Robert Arce(PrismaTech,Inc.) *Description: Procedure prototype for WX00001R program. *------------------------------------- *Modification Log * *------------------------------------ DWX00001R pr ExtPgm('WX00001R') * Procedure: WX00001R * Overview : Transfer a load * Input : * Returns : returns the error code D Iwarehouse 2a const D Oactiveflag 1a Program Interface (How) Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
Not having klist in the program can be a great advantage since the variables can be seen right there on the line. Of course this is part of Free-Form code. chain myklist99 WX00010TR; chain(Icompany:Iwarehouse:Iorder: Iordergen:Iparentorder)WX00010TR; NO more KLIST Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.
Start NOW !!!Adopt a conventionand write file driven services. Thank you !!! Rpg-ILE Maximum Speed by Robert Arce from PrismaTech.