Wednesday, October 23, 2024

Retrieving the library that contains the currently running program

The idea for this post came from a question. The questioner had a situation where, due to a mixed-up library list, someone had run the wrong version of a program from another library. They already had the program's name on their display files, and they asked was it possible to retrieve the library the current executing program is in, and add that to the their display files.

After some discussion we decided that any change would be needed in both RPG and CL programs. Fortunately, this is simple in both languages.

Before I start explaining my RPG and CL code I need to have a display file within which are fields for the program and the program's library. I created a simple display file to do this, called TESTDSPF:

01 A                                      DSPSIZ(24 80 *DS3)
02 A          R SCREEN
03 A                                  3  2'Program name  . :'
04 A            PGMNAME       10   O  3 20
05 A                                  4  2'Program library :'
06 A            PGMLIB    R        O  4 20REFFLD(PGMNAME  *SRC)

Wednesday, October 16, 2024

Audit Journal Data Mart

This is something that caught my attention when the latest Technology Refreshes were announced: the ability to create a database of journal entry types entries. I had been doing something similar using the CREATE TABLE SQL statement and various of the Audit journal entry services, AUDIT_JOURNAL_xx. But these additions added functionality that makes it easier for me to extract the journal entries from the System Audit Journal, QAUDJRN.

The two new additions are:

  1. MANAGE_AUDIT_JOURNAL_DATA_MART:  SQL procedure that uses the various AUDIT_JOURNAL_xx to create an output table.
  2. AUDIT_JOURNAL_DATA_MART_INFO:  SQL View that displays information about all the files created with the MANAGE_AUDIT_JOURNAL_DATA_MART SQL procedure.

Monday, October 14, 2024

RPG Cafe updated with Fall 2024 enhancements

The RPG Cafe has been updated with the four changes that will be coming in the latest Technology Refreshes, IBM i 7.5 TR5 and 7.4 TR11.

These enhancements are:

  • In preparation for the switch to the "1970" rule for six long dates, with two digit years, there will be a compile option when used allows you identify where a two digit year is used in the program or module, see here for more details.
     
  • The ability to use the %PROC BiF in the ON-EXIT section of a procedure. Learn more here.
     
  • Two new BiFs, %HIVAL and %LOVAL that will return the largest or smallest possible value that can be held in a variable. The details are here.

I consider these three great additions to the modern RPG language.

Thursday, October 10, 2024

NHMUG calls it a day

I am always saddened to learn that an IBM i Local User Group, LUG, stops functioning.

Yesterday, I learned the New Hampshire Midrange User Group, NHMUG, announced on their website that they were disbanding. You can read their announcement here.

This just leaves one IBM i user-related organization in the New England region, the Northeast Users Groups Conference. NEUGC holds an annual conference, see their website for details of the 2025 conference.

If you have any updates for any other IBM i related LUG please let me know via the Contact form on the right.

For a list of all the active IBM i User Groups I have found check out the user groups page.

Tuesday, October 8, 2024

Fall 2024 TRs announced

The Fall Technology Refreshes for IBM i 7.5, TR5, and 7.4, TR11, were announced this morning.

Having a quick glance at the announcement documentation from IBM it would appear that the two have the identical changes:

  • Db2 of i (SQL)
    • 14 enhancements
    • 9 new additions
  • RPG
    • 3 new additions

Wednesday, October 2, 2024

Audit Journal Entry Services

I have managed to persuade the admins of the server I use to develop the code for these posts upon to give me access to the Audit Journal, QAUDJRN, this gives me the opportunity to write about several enhancements that have made to Db2 for i that makes getting information from QAUDJRN.

Over the past few releases and Technology Refreshes IBM has given us many Audit Journal Services. As QAUDJRN contains many different types of journal entries IBM has given us a specific Audit Journal Service for just about every journal entry type.

All of Audit Journal Services are called: AUDIT_JOURNAL_xx, where xx is the journal entry type. As of IBM i 7.5 TR4/IBM i 7.4 TR10 there are 41 of these Audit Journal Entry Services, out of a total of 76. That is 54% of all journal entry types covered. I do not know if the plan is to cover all of the job entry types, or not.

Tuesday, October 1, 2024

October's presentations

This month I have three events I am involved with.


On Monday October 7 I will be talking to COMMON's N2i in a presentation called "Getting Started with Modern RPG Arrays and BiFs". As this is for the N2i it is designed to be at a suitable level for people new to the IBM i platform.

Thre presentation is free, and you can register at N2i website here.


I am talking with the West Michigan IBM i User Group on Tuesday October 15 about "Maximizing the benefits of embedding SQL in your RPG code". The presentation will start at 8:00 AM (ET).

WMSUG updated their website, therefore, you can learn more and register for this event here.


I am on my travels again visiting my friends for Common Denmark's annual conference, on Tuesday 29 and Wednesday 30 October. You can learn more about, and register, for the conference here.

I hope to see you there. And if you are attending and you see me, please introduce yourself and say "Hej".

Wednesday, September 25, 2024

Copy source members to the IFS

Someone asked me how I would write a program to copy all of the members in source files to separate files in the IFS, where they could then me imported into a GiT. I can see a program like this being more useful overtime as more people move from using source files to using a GiT repository.

In this example I will be copying all the source members from the source file DEVSRC in the library MYLIB to the IFS directory /home/MyFolder. The files in the IFS would all be named in the following way: source_member_name.source_member_type, for example: TESTRPG.RPGLE

My first attempt at creating a program to do this was to use RPG. I was going to use the CPYTOIMPF command within the QCMDEXC Scalar function. Alas, several hours of creating program I received the following message when running the RPG program for the first time:

Wednesday, September 18, 2024

New View lists all file members

If I wanted to get a list of members in a file with SQL I always had to work with the SYSPARTITIONSTAT View, which was not the purpose it was designed for. In the latest latest Technology Refreshes a new View has been added that is designed for information about members, SYSMEMBERSTAT.

The new SYSMEMBERSTAT View is in the library QSYS2 and contains all the columns I could want to know about members in a file.

I always recommend if this is the first time you are using a View you should look at all of the columns and determine, for yourself, which ones are important. The following statement displays all the columns in SYSMEMBERSTAT:

Monday, September 16, 2024

Fortra IBM i Marketplace Survey

Fortra, formerly known as HelpSystems, has opened their annual IBM i marketplace survey.

This is the eleventh-year they have had the survey. It provides a useful insight to what the IBM i community is up to, and what are their concerns.

The survey opened last Friday, and will close on October 31. The results will be published in January 2025.

I encourage you to take part. I did so on Friday.

You can get to the survey using the link here.