I wrote the the IBMi Object Utility to help with viewing multiple IBMi objects in a simple interface. This tool was written after I wrote several other Python articles on LinkedIn and shared on GitHub. (https://github.com/thomprl/ibmi_python_rpg_adventures). It allows you to enter a partial object name and search for the object in a defined library list. The results are displaed in a browser window in a html table. You can right click on the different objects to perform various actions.
Tables/Views/PF/Logical Files have the most options. When you right click on these type objects you can view the file layout, Display File Description (DSPFD), Display File Field Description (DSPFFD), Display Database Relationships (DSPDBR), Display Object Description (DSPOBJD), Generate a sample SQL Select and Insert Statement, Display Access Paths, and Add Notes.
On other objects like *PGM, *SRVPGM, *MODULE you can right click to DSPOBJD, DSPPGM, DSPMOD, DSPSRVPGM and Add Notes.
On all objects you can Add Notes. This just provides a way to store important information. These notes are stored by the object name and object type and are note specific to a library. This way if you have the same object in multiple libraries you can have one set of notes for that object name and type.
On the file layout view you can right click on a field and Add Notes to a particular field. This will allow you to document what valid values might go in a status field for example.
I'm not going to pretend this is a production ready tool. It's just something I wrote to help me view IBMi Objets in a simple way. I also was experimenting with AI and Python. A lot of the javascript was generated using AI. So there may be some inefficiencies in the code. You may question some of the design decisions I made. For the IBMi objects I wanted to be able to put in a partial name and see all the objects that matched which limited the usage of the SQL Table Function OBJECT_STATISTICS since it only allows a wildcard on a short name. Also I don't know how it will work with other CCSID so it might need tweaking depending on your CCSID.
There are two versions of IOU. One can be run directly on the IBMi using Python installed on the IBMi and the iToolkit modules. The other version can be run from your PC and connects to the IBMi using the pyodbc and iToolkit module but you must also install the IBM ODBC driver. The ODBC driver instructions and download can be found here: Instructions: https://www.ibm.com/support/pages/odbc-driver-ibm-i-access-client-solutions Download: https://www.ibm.com/support/pages/ibm-i-access-client-solutions
Both versions have the same functionality.
This just allows you to decide where you want to run the utility from as not everyone has Python installed on their IBMi.
- Python 3.x
- iToolkit module
- Python 3.x
- iToolkit module
- pyodbc module
- IBM i Access ODBC Driver
- Download the IBMi Object Utility from GitHub and place it in a folder on your PC or and IFS folder on IBMi.
- Install the required modules using pip from the correct requirements text file.
- For PC version use: pip install -r requirements.txt
- For IBMi version use: pip install -r requirements4i.txt
- Create the included (QSQLSRC) SQL tables in a library (iou_libl.sql and iou_notes.sql)
- Create the RPG program in the same library.
I like to run the utility from inside VSCode. Either a from PowerShell if running from a PC or from a PASE terminal if running from the IBMi. But this can be run from a QSH command line as well and even better from a batch job. I will include instructions from VS Code.
- Open VSCode and connect to your IBMi.
- Press Control + Shift + J and select the PASE terminal.
- Change to the directory where you placed the IBMi Object Utility files on the IFS.
- For the initial run we need to specify the library where the SQL tables and RPG program were created and specify a http port to use. This will create a config4i.json file that will be used for the future. You can change this file later if needed.
python iou4i.py --library YOUR_LIB_NAME --port ##### - Open a web browser and go to: http://YOUR_IBMi:##### (use the port number you specified above)
- After the initial run you can just run:
python iou4i.py
- Open VSCode
- Open a Powershell Terminal. Control + Shift + `
- Change to the directory where you placed the IBMi Object Utility files on the PC.
- For the initial run we need to specify the library where the SQL tables and RPG program were created and specify a http port to use. This will create a config.json file that will be used for the future. You can change this file later if needed.
python iou.py --library YOUR_LIB_NAME --port ##### - Open a web browser and go to: http://localhost:##### (use the port number you specified above)
- When you open the browser it will ask for the IBMi system name, username and password to connect to the IBMi.
- After the initial run you can just run:
python iou.py
When the RPG program gets called the first time it will take your current library list and populate the table IOU_LIBL with a list of libraries to search on. For me I like to remove QSYS and add a few others to that list. You can do this by running SQL statements against the IOU_LIBL table.
The reason I like to run from VSCode is mainly because I don't have to have an extra DOS Terminal Window Open. I can just use the built in terminal in VSCode.
- From the web browser type in a partial or complete object name to search and click Search.
- The results will be displayed in a table. Right click on any object to see the available options.
- After right clicking on an object and selecting an action a new tab will open with a brief title on each tab.
