ILE Concepts on AS400

April 2, 2018 | Author: Ramana Varala | Category: Compiler, Modular Programming, Subroutine, Program Optimization, Ibm Rpg


Comments



Description

May 2007Integrated Language Environment (ILE) ILE is an architectural change to language compilers and the runtime characteristics of AS/400 programs. It is an extension to the architecture which means that your existing programs continue to run without changing and recompiling. ILE is available with Version 2 Release 3 of OS/400. Integrated Language Environment is tightly integrated into the Operating System/400. The key benefits for the new ILE environment are: • Language Integration: Application programs are developed using the language mix best suited to perform each required function. • Reusability: Code from supported languages is divided into smaller, reusable, more logical modules that compile faster and require less maintenance over their life. • Performance: Capability is provided to optimize code in compute-intensive applications and to reduce the time to perform inter-program calls Integrated Language Environment increases developer productivity by providing the capability to divide code into smaller, more logical units that compile faster. The system binder combines the compiled modules to create the application program. In addition, the separation of compilation and bind steps provides more flexibility packaging the application. The new source level debug tool that supports the ILE languages provides enhanced capability over the system debugger with the new feature to debug at the source or listing level of the program. Step, breakpoint, and conditional breakpoint functions have been provided. Expressions are entered and evaluated using the syntax of the programming language being debugged. The current system debug facility remains unchanged for programs developed outside ILE. New family of compilers for AS/400 New RPG IV Compiler (The next generation of RPG) 2. New ILE CL compiler .1. New ILE COBOL/400 compiler (Improved structured programming support) 4. New ILE C/400 compiler (Improved performance) 3. ILE Benefits ILE offers numerous benefits not found on previous releases of the AS/400 system. Many of the application program interfaces (APIs) are also provided as bindable (service) programs. Multiple-language integration 4. A benefit of this binding process is that it helps to reduce the overhead associated with calling programs by reducing the number of external calls. Enhancements to the ILE compilers 5. Better call performance 2. it produces a module object (*MODULE) that can be combined. Reusable components 6. ILE offers common run-time routines used by the ILE-conforming languages. Code optimization 8. with other modules to form a single runnable unit. only dynamic (or external) program calls were available to the application . Modularity 3. This allows your applications to use APIs and to get faster ILE call performance. ILE programs are called just as you call programs in your current applications. Instead. Foundation for the future In addition. or bound. Tool availability 9. These benefits include: 1. Better Call Performance An ILE compiler does not produce a program that can be run. These off-the-shelf components provide such services as: Date manipulation Message handling Math routines Activation Groups Service Programs 1. Before ILE. or program. Control over application run-time environment 7. With ILE. However. Thus. two kinds of calls are available: Dynamic (or external program) calls [E. ILE C/400. your current application must perform a dynamic call to a separate program. a module of code written in ILE C/400 (perhaps a floating-point calculation) can be bound with modules written in ILE RPG/400. Multiple-Language Integration With your current application. bound calls offer better performance than dynamic calls. For example.g. or ILE CL. . 3. Simplified maintenance. They can be written in any language and can be bound for better performance. Modularity A more modular approach to programming provides numerous benefits to you. The APIs that IBM provides for ILE are just the beginning. modules written in any ILE language can be bound to modules written in the same or any other ILE language. The performance cost of the dynamic call to a program and the inconsistencies between language behaviors sometimes complicate the mixing of languages. However. COBOL. Maintenance may be required in only a single module. Program Calls] Static (or bound) calls [E. such as tax calculations. including: Faster compilation because the units of code to compile are smaller (especially in recompiling during development). Better programmer work load distribution.programmer. such as RPG. Increased ability to reuse a piece of code in a variety of applications. ILE COBOL/400. Vendors have more freedom to sell (and application programmers to buy) libraries of routines for any commonly used function. to access code written in another language. and C. Modules written for a specific function can be bound into several program objects. In addition. With ILE. you can acquire modules written in a variety of languages. This produces a better performing.g. and more easily managed application. Opportunities to both purchase and sell individual modules of code. Service Program Calls] The performance of dynamic calls in ILE programs is fairly close to existing call performance. without needing to produce the code yourself. you can mix different language programs. the binding capability and the improved call performance that results may encourage you to develop your applications with a more modular design. 2. the primary motivation for moving to ILE is to get access to the function that ILE language support provides. 5. 6. Your installation can develop its own set of standard routines. Many long-standing requests from RPG programmers have been addressed in the ILE RPG/400 compiler. Control over Application Run-Time Environment . Reusable components ILE allows you to select packages of routines that can be blended into your own programs. The same mechanisms that IBM and other vendors use to deliver these packages to you are available for you to use in your own applications. and do so in any language it chooses. Routines written in any ILE language can be used by all AS/400 ILE compiler users. including the following: 10-character field names Free-form logical and math expressions Date and time data types and operations External data items (data export) Uppercase and lowercase source File-level field prefix support Pointers For many programmers. The fact that programmers can write in the language of their choice ensures you the widest possible selection of routines. This is particularly true for ILE RPG/400. Enhancements to the ILE Compilers The ILE compilers have some significant new function included as part of the language. Not only can you use off-the-shelf routines in your own applications.4. which is based on the RPG IV language definition. you can also develop routines in the ILE language of your choice and market them to users of any ILE language. Then. 8. they perform better than they did with the previous C/400 compiler. it is a way to end an entire application rather than ending one program at a time. such as open data paths for the files used in the application. 7. an activation group has exclusive use of the resource. In addition. For example. we anticipate that many tool vendors will begin to add their tools to the AS/400 to attract a new marketplace for their products. you can use activation groups to set up logical boundaries within the job to separate the applications. Foundation for the Future . It aids in cleaning up its resources (such as open files and active programs) without disturbing resources associated with other applications active in the job. the programmer can select the desired level of optimization for each piece of code. these C language applications run faster. You can assign a name to the activation group within the job. In some cases. Thus. Within these boundaries. RPG programmers might think of this technique as a kind of application-level LR indicator. Making use of the C language offers you a greater choice of: CASE tools Fourth-generation languages (4GLs) Editors Debuggers 9. Therefore. ILE programs and service programs can be created to use the named activation group. these new levels of optimization may lead to improved performance of existing code. At compilation time. You can specify that a given ILE program run in a particular area within a job.ILE allows you to use better control over your application and the resources it uses. Tool Availability The majority of tools for developers in the computer industry today are written in the C language. Code Optimization The new ILE compilers and the associated OS/400 translator have more advanced optimization techniques built into them. With ILE binding capability and improved optimization. Using activation groups to isolate applications can also make it easier to end an application in a job. This area within a job is called an activation group. reusable components that efficiently transfer control among themselves offer you maximum flexibility. Applications constructed of large numbers of small. . you can look forward to even more significant enhancements. The move toward object-oriented programming languages and visual programming tools increases the need for the capabilities provided by ILE. You can use them multiple ways in multiple applications. modularized.In addition to the increased opportunity to optimize your applications with the current ILE compilers. all programs -. Control boundaries between activation groups can get complicated Module (*MOD or *MODULE) Calls between modules execute much quicker than calls between programs Can combine multiple modules to create an ILE program.now execute in activation groups). Takes modular programming on the iSeries to the next level Increases program size More disk space also required to store the module object itself. . Supports mixed-language programs. Job-related object used for executing programs Similar to the PAG but can be controlled much more (OPM programs used to execute in the job's PAG. Activation group (not an i5/OS object) Activation groups consume system resources.ILE & OPM -.ILE Objects ILE object type ILE program (*PGM) Function Key benefit Caveats The executable object. Errors/conditions are handled differently. Activation groups isolate programs and resources with the activation group. Same object type as for OPM programs (*PGM) but program type attribute is ILE. Multiple activation groups per job. Reusable: can include in more than one program. not an executable object Can run in any activation group (OPM programs can only run in default activation group). An intermediate object used to hold the result of compiling a source member before it becomes part of a program Contains only MI instructions. More than one binding directory can be used to create a single program.) The main advantage ILE programs enjoy over OPM programs is their ability to access all the new features that were introduced with ILE (e. Speeds application development Can be used to store creation information for multiple programs.. Binding directory (*BNDDIR) Allows saving and reusing some of the information needed to build an ILE program. ILE programs ILE programs are significantly different from OPM programs. Can lengthen program creation time if used carelessly.. But the real difference between program objects of type OPM and type ILE is the way they execute. whereas an OPM program will have a Program Type attribute of OPM. Activation groups With the introduction of ILE came activation groups -.a new type of process object. It's not a persistent. which . Similar to the object-list in a make-file (make-files are used on other platforms to automate program creation). ILE-specific language enhancements. deleted. storable type of object such as a program or a file. Programs do not run in program activation groups (PAGs) any more. ("Activation groups") 2. ILE-specific APIs.). when a job ends.e. its associated process objects are.g. *INIT in RPG). Design must be well thought out No support for an initial routine (i.e. 1.Service program (*SRVPGM ) Provides the fast moduleto-module call without increasing program size Activation group in which to execute can be specified (as for ILE programs) Similar to DLLs on the PC but with more features (except no initial control procedure like the DLL LibMain function).they are a different type of program object. they run in activation groups. a job) during the life span of the process. Although they do not represent a new object type -. A process object is a temporary object used by a process (i. etc. (An ILE program will have a Program Type attribute of ILE.they are still just *PGM objects -. for all intents and purposes. Create stand-alone programs and call them from other programs. Non-default activation groups do not have any of the overhead of the default activation group that is necessary to run OPM programs. are the building blocks of all ILE programs. there are non-default activation groups. This provides for true parameters. You can even specify that a program should run in the same activation group as the program that calls it. but it has the ability to emulate the OPM environment hence allowing OPM program to run on an ILE-based machine. but it is a slow calling interface. You can give your own names to activation groups or let the system name activation groups for you. it can be bound into both a service program and a regular program. The default activation group is an ILE activation group.before finally creating a program out of that temporary module. performance is slowed by the extra processing necessary to simulate the OPM environment. Modules are reusable.a special activation group called the default activation group. Unlike OPM programs. The word module is derived from the term modularize." Even OPM programs run in an activation group -. However. which we should all know by now is the most advantageous way to build reusable code. which must run in the default activation group. . giving us true parameter support and a fast call interface. into programs with either the CRTPGM or CRTSRVPGM command. object type *MODULE.can be thought of as "mini-PAGs. Even the CRTBNDxxx commands create a module object -. This provides a fast calling interface.albeit a temporary one in QTEMP -. Create subroutines in copy-members and include them in programs with the /COPY compiler directive. the only ways we had to modularize were the following: 1. They represent the result of compiling source members (with one of the CRTxxxMOD commands) before they are ultimately incorporated. which every job automatically has. ILE programs can run in any activation group you choose. They are intermediate objects between source code and programs. for example. but parameters have to be simulated using global variables. In addition to the default activation group. Modules combine the advantages of these two methods. 3. including service programs. This is done by specifying the value of *CALLER for the activation group attribute when creating the program. Since a module is a reusable object. With OPM RPG. as with any type of emulation. Modules These new objects. or bound. 2. It also increases the size of program objects. Use this to your advantage to isolate applications in their own activation group. As programs become more modular. the create program command was fairly simple: . Procedures in a service program are called using the CALLB or CALLP op-code (or in-line as part of an expression) in RPG.e. 5. It is created similarly to how programs are created. For example. Service programs provide common services that other ILE objects may need. a service program is a collection of runnable procedures and available data items easily and directly accessible by other ILE programs or service programs. Service programs Service programs are to the iSeries what DLLs are to PCs.Modules have one disadvantage. the complexity of the CRTPGM (or CRTSRVPGM) command becomes burdensome. adding size to both the source and executable program. It has an object type of *SRVPGM. the CALLPRC command in CL. A procedure in a service program (a procedure is a kind of self-contained subroutine or a mini-program) can be called with almost the same speed. Binding directories ILE programs and service programs are created by binding one or more modules and/or service programs together using the CRTPGM or CRTSRVPGM command. they increase program size. For example in OPM. a service program is similar to a subroutine library or procedure library. but the subroutine that is called must be part of the calling program. or the CALL PROCEDURE statement in COBOL. but the source and executable code of the procedure are not part of the calling program. though. They provide a fast calling interface without having to include code in your program. In many respects. Like the first OPM method. hence the name service program. 4. Service programs can be bound to (i. In short. used by) other service programs. This is especially advantageous when many programs call the same procedure. Service programs used by programs must be bound to the program using the CRTPGM or CRTBNDxxx command. in RPG the fastest calling interface is the EXSR opcode. except the CRTSRVPGM command is used instead of the CRTPGM command or one of the CRTBNDxxx commands. but remember as the number of entries in a binding directory goes up. MOD1.CRTRPGPGM PGM(MYLIB/MYPGM) SRCFILE(MYLIB/QRPGSRC) SRCMBR(*PGM) However. SRVPGM2 and SRVPGM3) would require a CRTPGM like following at a minimum: CRTPGM PGM(MYLIB/MYPGM) MODULE(MYLIB/MYPGM MYLIB/MOD1 MYLIB/MOD2 MYLIB/MOD3) BNDSRVPGM(MYLIB/SRVPGM1 MYLIB/SRVPGM2 MYLIB/SRVPGM3) The solution is to use a binding directory. as in CRTPGM PGM(MYLIB/MYPGM) MODULE(MYLIB/MYPGM) BNDDIR(MYLIB/MYPGM) the system uses the list of modules and service programs in the binding directory as if they had been specified individually on the create command. is nothing more than a stored list of module and service program names. When a binding directory is specified on the CRTPGM (or other command). Binding directories can also be used to group modules and/or service programs into logical groups. MOD2 and MOD3) and three service programs (SRVPGM1. a program that is made up of four modules (MYPGM. Modules or service programs listed in a binding directory are used only if they provide an export that can satisfy any currently unresolved import requests. You can even create a "super" binding directory that contains the names of all the modules and service programs on your system. . object type *BNDDIR. so does the program creation time. in ILE the complexity of the create program command grows proportionately to the number of modules and service programs that compose the program. For example. A binding directory. without the use of a binding directory. bound) program in one step. 3. CRTCBLMOD. 2. The xxx is replaced with the appropriate language designator. CRTxxxMOD These Create Module commands compile source members of the various ILE languages into ILE modules. or CRTCLMOD. such as RPG. CBL.into a single executable program. CRTCMOD. These commands can also be used to create an ILE program that runs in the default activation group. which . CRTPGM The Create Program command allows you to bind together one or more modules -. C. The modules can be of different languages. or CL.created with the CRTxxxMOD commands -.e.. intermediate non-executable objects that can be bound into ILE programs. CRTBNDxxx These Create Bound Program commands combine the function of the CRTxxxMOD and CRTPGM commands. to produce CRTRPGMOD.ILE-related Commands Module and program creation commands 1. They can be used to quickly compile a source member and automatically bind the resulting (temporary) module into an executable ILE (i. and CRTSRVPGM commands. CRTBNDDIR The Create Binding Directory command creates a "shell" to hold binding directory entries that you add later using the ADDBNDDIRE command.is not an option when you use the CRTPGM command. Binding directories can be specified on the CRTPGM. CRTBNDxxx or CRTSRVPGM command. You must use binding directories to reference other modules or service programs on the CRTBNDxxx commands. 6. procedures and variables) when the binding directory is specified on a CRTPGM. The binding directory entries are then used to locate unresolved procedures. Using binding directories can significantly reduce the amount of information required on the CRTPGM. thus increasing productivity. Note: You cannot list any other modules on the CRTBNDxxx commands to bind into the program (as you can on the CRTPGM command).e. CRTBNDxxx. Only the names are stored in the binding directory. CRTBNDxxx. ADDBNDDIRE The Add Binding Directory Entry command can be used to add module and service program names to a binding directory. The stored names are then used as references to locate unresolved externals (i. and CRTSRVPGM commands. Like the CRTxxxMOD commands. not the actual module or service program. Binding directory commands 5. Binding directory entries are references to modules and service programs. CRTSRVPGM The Create Service Program command is similar to the CRTPGM command except it creates a service program. . 4. you should replace the xxx in CRTBNDxxx with the appropriate language identifier. Module and program maintenance commands . WRKBNDDIR The Work with Binding Directories command allows you to interactively work with a list of binding directories. RMVBNDDIRE The Remove Binding Directory Entry command is the opposite of the ADDBNDDIRE command. DSPBNDDIR The Display Binding Directory command is used to display the entries stored in a binding directory. 9. WRKBNDDIRE The Work with Binding Directory Entries command allows you to interactively work with the entries of a binding directory. 8.7. 10. it removes a specific entry or group of entries from a binding directory. adding and removing them with simple menu commands. program or service program. . 12. They are similar to the "old" CHGPGM. For example. they can be used to optimize or remove observability from a module. UPDPGM and UPDSRVPGM These commands allow you to replace one or more modules in a program or service program with new modules without requiring you to recreate the entire program. WRKMOD. WRKPGM and WRKSRVPGM These commands allow you to interactively work with a list of modules. programs and service programs. program or service program. programs and service programs. DSPPGM and DSPSRVPGM These commands display information about a module. respectively. 13. 15. respectively. respectively. respectively.11. The new modules must have the same name as the ones to be replaced. programs or service programs. DLTMOD. DSPMOD. CHGMOD. DLTPGM and DLTSRVPGM These commands delete modules. CHGPGM and CHGSRVPGM These commands allow you to change certain attributes of modules. 14.
Copyright © 2024 DOKUMEN.SITE Inc.