Wednesday, February 19, 2025

Displaying the configuration status using SQL

I don't use the Work with Configure Status command, WRKCFGSTS, frequently, mostly to vary on and off devices and occasionally controllers. I know that others do, and I have been asked to provide information such as a list of all the controllers' status.

As part of the last round of Technology Refreshes, IBM i TR5 and 7.5 TR11, a new View was added that allows us to see the same information in a better way.

With the WRKCFGSTS I am limited with the data I can retrieve.

                  Work with Configuration Status (WRKCFGSTS)

Type choices, press Enter.
                                                            
Type . . . . . . . . . . . . . . CFGTYPE           
Configuration description  . . . CFGD         *ALL      
Output . . . . . . . . . . . . . OUTPUT        *     
Remote location  . . . . . . . . RMTLOCNAME    *NONE   
Range  . . . . . . . . . . . . . RANGE         *NET
Status . . . . . . . . . . . . . STATUS        *ALL      

The valid configuration types, CFGTYPE, are:

Wednesday, February 12, 2025

New SQL procedure to end multiple jobs

As part of the latest Technology Refresh, IBM i 7.5 TR5 and IBM i 7.4 TR11, comes a new SQL procedure easily end multiple jobs in one statement. This procedure is called END_JOBS, and it is found in the SYSTOOLS library.

This procedure has ten parameters, most of them will be familiar you if you know the End Job command, ENDJOB. The parameters are:

  • JOB_NAME_FILTER:  The unqualified job name, what I called the "short job name". If not given the default is *ALL.
  • CURRENT_USER_LIST_FILTER:  Up to ten user profiles, separated by a comma. The default is for all users.
  • SUBSYSTEM_LIST_FILTER:  Up to 25 subsystem names, separated by a comma. If not given them all subsystems are considered
  • END_OPTION:  Like the OPTION parameter in the ENDJOB command. The allowed values are CONTROLLED or IMMEDIATE. Controlled is the default.
  • END_CONTROLLED_DELAY:  Like the DELAY parameter of ENDJOB. If the END_OPTION in controlled then this is the number of seconds it waits before it ends the job.

Monday, February 10, 2025

I was today's years old when I learned...

In my 37 years of working with IBM midrange, and especially IBM i and its predecessors, I learned something new that has blown my mind.

Spool as in "spool file" is an acronym!

I have always thought that "spool" was the queue of spool files on an output queue. A long list of spool files would be like piece of thread from a spool of thread. It turns out my assumption is wrong.

I have Alan Seiden to thank for bringing this to my attention.

It turns out the definition of a "spool" is:

Wednesday, February 5, 2025

Retrieve procedure name in the ON-EXIT section

Prior to the latest Technology Refreshes, IBM i 7.5 TR5 and 7.4 TR11, it was not possible to get the procedure's name using the %PROC built in function in the ON-EXIT section of any procedure.

IBM explained to me that the ON-EXIT section of a procedure is another procedure, which is why they would not allow the procedure name to be returned, as it would not be what I expected.

In the latest TR IBM has provided us with a solution. There are now three versions of the %PROC BiF:

Wednesday, January 29, 2025

New SQL scalar functions to generate UUID

At times there a coincidences, and this is one. I had been asked to add a UUID column to a SQL table that is sent to another application on a non-IBM server. My original plans were to use the MI program _GENUUID to generate the UUID. Then, to my delight I find that the latest Technology Refreshes, IBM i TR5 and IBM i TR11, includes two new SQL scalar functions that will generate an UUID. Which is ideal for me as I was using a SQL Insert statement to add data to the interface's table.

What is UUID? Without going into too much detail, it stands for "Universally Unique Identifier". It is administered by the Internet Engineering Task Force, IETF, with a standard, RFC9562, which defines it as: "A UUID is 128 bits long and is intended to guarantee uniqueness across space and time". If you are interested in learning more the standard's document is here.

In character form a version 4 UUID is 36 characters, and is formatted thus:

 XXXXXXXX-XXXX-4XXX-XXXX-XXXXXXXXXXXX

Monday, January 27, 2025

How would I validate and format dates to align with the "2039 issue"

After my post about IBM providing a control option to look for dates that could fall foul of the 2039 issue, someone messaged me to ask:

I think the problem is when date is converted an external representation and converted back. I think of a display file, if the user input in a display file say an expiry date in 2041 how would you handle the display and conversion?

That is a good question. There are times when users should have to enter eight long dates for things like dates of birth, but other dates can be used on a display file as six size long and stored in the database as a date data type. With the impending "2039 issue" how would I manage the need to change from the "1940" rule to another?

Wednesday, January 22, 2025

Identifying code that could fail the "2039 problem"

As soon as we handled Y2K I thought when we reached date 2039 we would have something in place to prevent the "2039 problem".

What is the "2039 problem"? This only occurs with dates with years that are just two characters. A date data type, character or numeric representation of a date, that has a two character year uses the following rule to determine the century:

  • 40 – 99:  Century is assumed to be "19"
  • 00 – 39:  The assumption is that the century is "20"

We are 14 years away from 2039, but soon there a going to be applications that will need to use dates beyond that year. When I attended COMMON's Navigate in Toronto, in November 2024, Barbara Morris, IBM's lead developer for the RPG compiler, told us that it would be up to us, the IBM i developers, to remedy the issue. The way RPG handles dates will remain unchanged.

Monday, January 20, 2025

IBM Power9 maintenance end of life

On September 12 last year IBM published a document about the future of maintenance for some of the IBM Power9 servers.

In it IBM explains that after eight years of IBM Power9, the end of their Standard Service maintenance for various Power9 servers is effective January 31 2026.

I think this is brought on by the expected announcement of the IBM Power11 chip based servers later this year.

IBM's document gives you all the information, therefore, I am not going to repeat it. You will find IBM's document here.

Wednesday, January 15, 2025

New built in functions %HIVAL and %LOVAL

As part of the latest Technology Refreshes, IBM i 7.5 TR5 and 7.4 TR11, two new RPG built in functions, BiF, were added: %HIVAL and %LOVAL.

Their names describe what they return:

  • %HIVAL:  Returns the highest value that can be returned from the variable
  • %LOVAL:  Returns the lowest value that can be returned from the variable

The syntax for the BiF is:

  %hival(variable)

  %loval(variable)

Wednesday, January 8, 2025

How to create a logical file with data from more than one member

I wrote an earlier post about how to define a file twice in a RPG program so that I can use two members in the file. This led to a further discussion about could I combine data from those multiple members into one using a DDS logical file. This post demonstrates the results of those subsequent discussions.

I am going to use the same file as I did in the earlier post. If you have questions about file layouts, etc., check that post.

I am going to add a third member to the file, which will be called THIRD:

ADDPFM FILE(TESTFILE) MBR(THIRD) TEXT('Just added')

I can list the members in TESTFILE using the SYSMEMBERSTAT SQL View:

Monday, January 6, 2025

The future of IBM Power CPUs

A "Chips and Cheese" interview with George Cozma, "Cheese", hosting Bill Starkey, Chief Architect for Power chips. They discuss the future of IBM Power and where Bill sees the industry going for future memory standards.


Wednesday, January 1, 2025

Happy 2025 to you all

Another year has passed, and now our thoughts turn to the New Year, 2025. New Years is one of my favorite times of the year, it is filled with excitement for what the forthcoming year will bring us all.

Before we put the old year out of mind, what did you find interesting last year? These were the top ten popular posts from last year: