Compiler Directives for RPG Programs and Modules
November 13, 2002 Ted Holt
I would like to define a standard set of H specs for my RPG source members so that all will compile with the same options. However, some RPG source members are compiled as modules and others are compiled as standalone programs. This means I can’t include the DFTACTGRP and ACTGRP keywords in the standard H specs because RPG doesn’t allow them when compiling modules. Do you have any tips that will help me solve the problem?
In V5R1 IBM added some new predefined compiler conditions that will help you solve this problem. The new conditions are also available for V4R4 and V4R5 as PTF SF65716.
- *ILERPG is defined if you are compiling from the iSeries RPG ILE compiler, but not defined if you are compiling with VisualAge RPG.
- *CRTBNDRPG is defined if you are using the Create Bound RPG Program (CRTBNDRPG) command to compile the source member as a standalone program.
- *CRTRPGMOD is defined if you are using the Create RPG Module (CRTRPGMOD) command to compile the source members into a module object.
- *VxRxMx is defined if your compiler is at or above the release you indicate. The earliest release you may specify is V4R4M0. You can use this condition to include different code sections for different releases.
I threw the following two source members together to address your situation. The first source member, HSPECS, contains compiler options:
/if defined(*crtbndrpg) H dftactgrp(*no) actgrp(*new) /endif H indent('| ') option(*srcstmt: *nodebugio)
I was able to compile the code in this source member with both CRTBNDRPG and CRTRPGMOD:
/include qrpglesrc,hspecs D somevar s 4a C eval somevar = 'ABCD' /if defined(*crtbndrpg) C eval *inlr = *on /endif C return
Why Viacom Outdoor Selected ASNA Visual RPG for Web Development
Viacom Outdoor, tasked by the Mississauga city government with providing transit shelter cleaning and maintenance service, realized that their current reporting system was inconvenient and cumbersome for all parties involved (Viacom, subcontractor, city government officials). To reduce costs related with this process, Viacom decided that the best approach was to develop an on-line system that all parties could access. The resulting Web application allows subcontractors to submit, on-line, their activities and time spent for cleaning services to Viacom Outdoor. The new system is a great benefit to the subcontractor since it provides them with accurate, up-to-date information about what work to perform and it is helpful to Viacom Outdoor because all of the verification information is input directly into their iSeries database. Additionally, city officials can see the reports of these services in real-time via the same Web application at any time.
“The best thing about AVR, from a management perspective, is the speed with which we are able to develop applications. The programmers, who already understood the business very well, were able to put to use their existing RPG skills and that was key to our choosing AVR. This Web application has been really beneficial to us. It’s not only easier for all parties involved to see the important information, but we are able to implement it with our existing equipment. The only cost to us was development time which is something that would have been incurred anyway.”
Download your FREE copy of ASNA Visual RPG today!