IBM Bolsters RPG And COBOL Development
May 13, 2019 Alex Woodie
Amid the many and varied enhancements that IBM rolled out last month for its IBM i operating system was a collection of improvements for its core development tooling, including the Eclipse-based Rational Developer for i (RDi) as well as Rational Development Studio for i, which contains the RPG and COBOL compilers.
Let’s start with the RPG and COBOL compilers in Rational Development Studio for i, since updates to these strategic pieces are more infrequent than the updates to RDi, which shares a common base with integrated development environments (IDEs) for other operating systems and therefore updated more frequently.
The biggest new RPG function in IBM i is support for dynamically sized arrays. In IBM i 7.4, IBM is introducing the new DIM keyword that will define the varying-dimension array. This will give programmers a powerful new tool for using arrays in their work, especially in environments where fixed-size arrays aren’t able to keep up with fast changing datasets.
As IBM explains in this Knowledge Center post on the dynamically sized arrays, programmers have two main options, including DIM(*AUTO:maximum_elements) or DIM(*VAR:maximum_elements). Read the post to get the scoop on what controls IBM is giving programmers to change the array dimensions, and how indexes are created, and other aspects of the new feature.
There are some caveats with dynamically sized arrays. It’s currently limited to use on standalone fields and data structures, according to Morris, and is not currently supported on subfields or parameters. And it will remain an IBM i 7.4 affair; there will be no PTF bringing it to IBM i 7.3, she says.
IBM also added the new SAMEPOS keyword to the RPG compiler. This keyword positions a subfield at the same starting position as another subfield. This functionality was added to IBM i 7.3. As IBM’s Barbara Morris explains in this RPG Cafe blog post, the subfield defined with SAMEPOS doesn’t have to fit within the overlaid subfield, which is different than how things work with the OVERLAY keyword.
“The SAMEPOS keyword is most useful when defining an array over several externally described subfields,” she writes.
This SAMEPOS functionality was well-received by numerous IBM i developers. Many developers have been looking for this type of functionality for a while, as they used other techniques to approximate what SAMEPOS delivers as a more elegant solution.
IBM also bolstered the RPG runtime in 7.2 and 7.3 with two new subfields for the Program Status Data Structure (PSDS), the part of the program where the programmer can specify exception and error information handling. The two new subfields include “internal job ID,” which can be specified in positions 380 to 395, and “system name,” which occupies positions 396 through 403, according to Morris’ RPG Cafe post.
IBM included several other RPG-related enhancements in its IBM i 7.4 announcement, including the DATA-INTO operation code, but these are items that had previously been released.
There is, however, news on the COBOL front, which is news in and of itself. COBOL makes up a small fraction of the IBM i developer base, but it’s a steady base and one that IBM does give some love to from time to time.
Specifically, in Rational Development Studio for i, IBM is bolstering the COBOL compiler with several new statements. For starters, IBM states that “the new ALLOCATE statement obtains dynamic storage, while the new FREE statement releases dynamic storage that was previously obtained with an ALLOCATE statement.”
IBM has also included a new EXIT statement that includes a couple of new formats, including an EXIT PERFORM statement, and the option of using the EXIT PARAGRAPH or EXIT SECTION statement. IBM also made enhancements to the INITIALIZE statement. It also added a new FILLER phrase, a new VALUE phrase, and augmented the INITIALIZE statement to supports certain edited data sets.
But wait, there’s more COBOL news! The compiler for COBOL on IBM i also get a new table sort option for the SORT statement. It also gets new compiler directives to support conditional compilations, including DEFINE, EVALUATE, and IF directive; a new DEFINE parameter for the CRTBNDCBL and CRTCBLMOD commands; and a new floating comment indicator.
Rational Developer for i
On the other side of the fence, we have RDi, the Eclipse-based IDE that developers use to write RPG and COBOL applications (not to mention Java, C, or C++ apps, if they’re into that sort of thing).
IBM is making several (mostly minor) updates with RDi 9.6.x (the exact version number ostensibly will be named when it ships; RDi 18.104.22.168 shipped in December). IBM i listed several items in its April 23 announcement for IBM i 7.4 and IBM i 7.3 TR6.
For starters, the new ILE RPG features in IBM i 7.4 (including the dynamically sized arrays discussed above) will be supported with the verifier and syntax checker, IBM says. The RPG ILE Parser will also include “the capability to search for code that appears to be out of place and report these discoveries with annotation,” IBM says.
SQL formatting is improved with this release, according to IBM, which says a new API is available that’s usable by both Access Client Solutions (ACS) and RDi. A new “smart enter key” is enabled that allows easier line splitting.
IBM added an API that allows “SystemTextEditors” to report an IBM i connection and member properties. There’s a new way to zoom in and out of the editor using command keys. Free-form RPG comments can now be repeated from previous opcodes more easily.
RDi also gets a “Toggle editor” to the outline view that allows the display of procedure and subroutine names while navigating in the editor, IBM says.
IBM also bolstered PDM Perspective, which debuted in RDi last year. New functions include a new command (Alt-F13) for repeating options displayed in the options field of the Member Object table view. Users also will benefit from new “entry actions” that will allow them to repeat Object Table actions in one panel instead of using a series of pop-up commands.
IBM i 7.4 will be generally available June 21.