Wednesday, February 26, 2025

Faster way to check authority to IFS object with SQL

I could already check my authorization to an object in the IFS using the IFS_OBJECT_PRIVILEGES SQL Table function. If I wanted to check if I was authorized to, let's say, read the object the Table function still takes time to retrieve columns of data even if I don't include them in my result set. A better approach would be if I can just check if I am authorized to an IFS object, and have a return code that indicates if I am authorized or not.

A new SQL scalar function, IFS_ACCESS, was added as part of the last round of Technology Refreshes, IBM i TR5 and 7.5 TR11, that does this, which makes the time taken to check if I am authorized a whole lot faster.

All of examples are going to use a stream file, *STMF, in my folder in the IFS. I can check who and what authorizations they have to the object by using the IFS_OBJECT_PRIVILEGES View:

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: