Code for IBM i is a development environment that enables IBM i program development with Visual Studio Code. Still, it has features not seen in the IBM i market before, such as being open source, being developed by a community of volunteers, and having IBM engineers participate in its development. Users who precede all the others highly evaluate it as a “usable tool.” Although Code for IBM i is still in the development phase and there are still some uncertainties, we will introduce an overview of Code for IBM i.
CONTENTS
Code for IBM i: The whole picture
Part1 About Code for IBM i
・Introduction
・About Code for IBM i
・Development Environment
Part2 Basic Usage
Part3 Maintenance of source code
・Maintenance of source code on IFS
・Maintaining local source code
Part4 Can it replace SEU/PDM?
Part5 Useful extensions other than Code for IBM i I
・CL
・RPGLE
Part6 Useful extensions other than Code for IBM i II
・IBM i Notebooks
Part7 Creation and execution of translation programs using DeepL API
・Summary
Part8 Special Contribution 1
・Impressions and evaluations as a Code for IBM i user
Part9 Special Contribution 2
・A case study of ushiday’s use of Code for IBM i
Code for IBM i: The whole picture | Part 1 About Code for IBM i
By Makoto Ogawa, T&Trust K.K.
Introduction
In May 2022, IBM i 7.5 was announced as a new version of IBM i. Its centerpiece is IBM i Merlin which is a package that includes a browser-based development environment, source code management (Git), Jenkins for CI/CD, and an RPG converter, all of which are essential for DevOps development. With the announcement of Merlin, IBM has completely shifted from the traditional SEU/PDM development environment to a development environment using open source.
Code for IBM i, which has recently become a hot topic in the IBM i community, is also an open source development environment. I hope you will take the first step toward an open source development environment through Code for IBM i.
About Code for IBM i
As a review of the feature article “Introduction to Visual Studio Code for IBM i Users” in the i Magazine 2022 Winter issue(January 2022), I would like to explain again what Code for IBM i is.
Code for IBM i is an extension of Visual Studio Code (VSCode) provided by Microsoft. As the term implies, extensions enable functions that are not supported as standard in VSCode to be added later, and once Code for IBM i is installed, IBM i program development can be performed in VSCode. Of course, Code for IBM i can be installed and used free of charge like other extensions (Figure 1).
Here, I would like to summarize the features of Code for IBM i.
(1) maintenance of RPG / CL / COBOL source code is possible with VSCode
(2) compiling from VSCode is possible
(3) direct editing of IBM i source file members is possible
(4) direct editing of source code files placed in IFS of IBM i
(5) ability to push local source code to IBM i’s IFS
The functionality of (3) is something that SEU/PDM users should feel free to try as a starting point for using this extension. In particular, the ability to solve the 5250’s screen size problem (narrow), which was a major problem when using SEU, is significant: VSCode can fully utilize the display size of the development PC, allowing a bird’s-eye view of the source code without being limited by the size of the 5250 emulator. For this reason alone, IBM i users should use this extension.
As mentioned in the feature article “Introduction to Git for IBM i Users” in the i Magazine 2021 Autumn issue, it is a matter of course that source code is change-managed and the source code of programs running on the IBM i is naturally no exception. Git is the de facto standard for version control tools, and with VSCode and Code for IBM i, it is possible to use Git to manage RPG and other source code changes. (5) are essential for achieving this.
Functions that will replace SEU/PDM
I will now explain why Code for IBM i replaces the legacy development environment of SEU/PDM with the open development environment of VSCode, the most widely used development environment. But first, let us compare it with other development environments available on IBM i.
First, the procedure for creating a program on the IBM i is
(1) Input source code
(2) Compile the source code
(3) Check the compile list in case of compile error
(4) If compilation is successful, test the program (including debugging functions)
However, since (4) can only be done in the 5250 environments in some cases (e.g., interactive programs), we will consider options for operations (1) through (3).
Currently, three options for development environments can realize (1) through (3)(Originally, IBM i Merlin should also be included in the evaluation target, but in addition to pure programming functions, it is a development platform that will continue to add functions necessary for the entire system life cycle, such as CI/CD functions. Therefore, it is regarded as a product of another dimension and is excluded from the object).
(A) SEU/PDM
(B) RDi
(C) VSCode+ extensions
There are various evaluation criteria for which one should be adopted, but this time we will focus on the following two points.
a. Whether RPG III, RPG IV, and free-form RPG can be developed
b. Whether or not version control of source code is possible
The evaluation results are summarized in Figure 2.
According to the results, (B) RDi is perfectly compatible with RPG III, RPG IV, and free-form RPG, and (B) RDi and (C) VSCode+Code for IBM i are capable of source code version control.
Considering that it does not support free-form RPG and that source code version control with Git is now mandatory, we see no reason to select (A) SEU/PDM.
Although RDi meets the two evaluation criteria, it is not necessarily a standard development tool for IBM i users. The fact that it is paid for is also one of the reasons why it is not widely used. Nevertheless, since it is a development environment provided by IBM, it is a tool that should be used by users who need support from the manufacturer.
Code for IBM i is rated “Good” for RPG III and RPG IV development. This is due to the following reasons.
・Compiling RPG III code while managing it with Git is impossible.
・Lack of line-by-line prompt function of RPG Ⅲ.
・There is a difficulty in the line-by-line prompt function of RPG IV.
・There is no line-by-line error-checking function similar to SEU.
First, let us explain why version control of RPG III code is impossible with Code for IBM i alone. It was mentioned earlier that this extension has a function to push local source code onto the IFS of IBM i. However, the compiler of RPG IV (free-form RPG) has a parameter to refer to the source on the IFS, so there is no problem. Still, the compiler of RPG III can only refer to members of the source file, so even if Git Even if you can edit the source under the control of Git (on the disk of the development PC), you cannot compile the source file as long as you cannot push it to the members of the source file. I will explain how to solve this problem later in this article.
Next, let’s look at the prompt functionality. However, Code for IBM i does not provide a prompt function, so this may be a concern. For RPG Ⅳ, fixed position input is possible using another extension (later discussion).
With this “Good” rating, it is easy to conclude that it is “therefore unusable,” but it is also impossible to conclude that it is SEU/PDM. Therefore, in the latter part of this article, we will consider how to make “unusable” into “usable.”
Development Environment Bird’s-eye View
Now, I want to summarize the scope of Code for IBM more concretely, focusing on the source code. For comparison, we will also consider the range of SEU/PDM and RDi (Figure 3).
Now, let’s summarize the source code storage location in the diagram of each tool and the corresponding status of each operation in a table.
(1) Source file
All three tools can access source files, but there are some differences: Code for IBM i is “Good” because the prompt function is not provided for RPG III and IV; SEU/PDM is “Good” because the line-by-line syntax checking of the editor in RPG IV is not complete; and SEU/PDM is “Good” because the line-by-line syntax checking of the editor in RPG III is not complete. It is possible to ignore errors and save, but it could be more practical (Figure 4).
(2) Source code on IFS
SEU cannot directly modify source code on IFS, so all are “Poor”; Code for IBM i is “Good” for the same reason as for source files (Figure 5).
(3) Source code on development PC
Since SEU is a tool on IBM i, accessing the source code on the development PC is impossible, so all of them are “Poor.” On the other hand, Code for IBM i is “Good” for the same reason as in (2) (Figure 6).
(4) Push source code on development PC to IFS
RDi can be pushed using the IFS project function (Remote Reconciler); Code for IBM i is described later (Figure 7).
(5) Push source code on development PC to source files (members)
RDi can push to source members from local using an iProject. This is not possible with Code for IBM i, so RPG III source code maintenance is not possible with Code for IBM i alone (Figure 8).
(6) Execute compiler
For RPG, there are two compilers (CRTRPGPGM and CRTRPGMOD). They can be executed from any development environment (Figure 9).
(7) Processing IBM i objects
Basic operations such as listing objects and deleting them are available for any of the tools (Figure 10).
Use of Git
As mentioned, Git cannot be used in the SEU/PDM environment (Figure 11).
The above comparison shows that while Code for IBM i cover most of the functions provided by RDi, the following are weak.
・It does not have a prompt function.
・Cannot push local code directly to source file members
Conversely, if the above problems can be solved, Code for IBM i can be used as an alternative to RDi. With this possibility in mind, let’s take a concrete look at how to use Code for IBM i.
Author
Makoto Ogawa
President and CTO,CIO
T&Trust K.K.
https://www.tat.co.jp/
Since 1989, he has been responsible for system development and programming training on AS/400. He learned how IFS works on OS/400 V3R1 through Linux, and since then, he has been deeply interested in open source in IBM i. His theory is that developer needs knowledge of Linux to understand IBM i. He has also written many articles for i Magazine.
Contents of Code for IBM i: The whole picture
Part1 About Code for IBM i
Part2 Basic Usage
Part3 Maintenance of source code
Part4 Can it replace SEU/PDM?
Part5 Useful extensions other than Code for IBM i I
Part6 Useful extensions other than Code for IBM i II
Part7 Creation and execution of translation programs using DeepL API
Part8 Special Contribution 1
Part9 Special Contribution 2
[i Magazine・IS magazine] https://www.imagazine.co.jp/