Wednesday, July 17, 2024

List all object types using SQL

Have you ever wondered how many different types of objects there in IBM i? And what the types of objects are?

The latest Technology Refreshes give us a SQL View that contains that information, and we can query it to answer those questions.

The SQL View is called SYSTEM_OBJECT_TYPES, and it is found in the QSYS2 library. It has three columns:

  1. OBJECT_TYPE:  Object type
  2. TEXT_DESCRIPTION:  Description of what the object type is
  3. CATEGORY:  There are two categories:
    IFS - object is in the IFS
    LIBRARY - object resides in a library (not an IFS object)

Thursday, July 11, 2024

New functionality added to RPG's SND-MSG op code

Two years ago the Send Message, SND-MSG, operation code was added to RPG. In the latest round of Technology Refreshes a number of new options have been added to SND-MSG and the Target, %TARGET, built in function.

To oversimplify it SND_MSG consists to three parts:

  1. Type of message to send
  2. Message text or variable
  3. The target for the message, which is the %TARGET built in function, BiF. This is optional

For example:

 SND-MSG *INFO 'Message text goes here' %TARGET(*SELF)

Wednesday, July 10, 2024

Deleting old device definitions

Last month I wrote about a way to list all of the unused virtual devices in your partition. In response to the article I received a question: "Is there a way to then delete these devices, other than manually going through? One system I just did has over 5,000 devices...."

The answer, of course, is yes there is. Before I give my final result let me go through the steps I did to create a SQL script to delete the unused virtual devices.

I can identify the virtual devices using the Object Statistics SQL Table function. I do not want to repeat myself. For the details read my previous article.

I decide to create a Common Table Expression, CTE, as it was just "neater". In the first part of the statement I would create a virtual table of all the eligible virtual devices, and in the second I would delete them. To start with I just want to make sure I gather the data I expected, therefore, my first statement did not do any deleting.

Wednesday, July 3, 2024

Constant keyword added to RPG definitions

As part of the latest Technology Refreshes, IBM i 7.5 TR4 and 7.4 TR10, comes an addition to the variable and data structure definitions. It is now possible to use the constant keyword as part of those definitions to protect them from being changed.

Why would I want to do that?

There are times I want to use a variable, rather than a constant. It might be to contain a date. I would not want this to be changed, either on purpose or by accident.

Below is an example:

01  **free
02  dcl-s StartDate date inz(*sys) const ;
03  dsply StartDate ;
04  StartDate = d'2024-07-04' ;

Monday, July 1, 2024

July's presentations

This moth I have two events I will be talking at.

I will be the speaker of the July meeting of the Central Texas IBM i User Group, CTXiUG. This meeting is on Tuesday July 9 at 6:30 PM (CT. I will be talking about various ways I have used SQL on IBM i to keep partitions clean of old objects, etc.

You can register at the CTXiUG website here.

Later this month I will be attending and presenting at one of my favorite conference's, OCEAN user group's TechCon24. The conference is a four-day affair. The first day, Wednesday July 24, is online. I am presenting in person on the second and third days, Thursday July 24 and Friday July 25. On Saturday, July 27, is their day of workshops.

You can learn more about the best user group conference in the western USA at their TechCon24 website here. You can register for the event from the same page.

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

If you are a member of an IBM i Local User Group, LUG, and you would like me to talk to your group, use the contact form to reach me. We can then arrange a date and subject.

If you are a member of a LUG that is not listed on my LUG page, please contact me and send me your group's details.