Tuesday, July 26, 2022

Which files are used by a Query?

query files used

This is a question I am asked enough for me to want to write this so I can direct the askers here. The question is:

How can I discover the files used by all the Query/400 objects in a library?

The Query/400 object is called a Query Definition, and is the following object type: *QRYDFN

To generate a list of the files they use is a two-step process.

The first process is to create an output file that contains the data. I use the Display Program Reference command, DSPPGMREF, to generate the output file. If I wanted to list all the files used by all of the Query definitions in the library MYLIB I would use the following:

Wednesday, July 20, 2022

Access System Directory information via SQL

system directory entries

I was asked for a list of all the enabled user profiles that are enrolled in the system directory on a partition. I know I could use the Display Directory Entry command, DSPDIRE, to create an outfile of the information:

DSPDIRE OUTPUT(*OUTFILE) OUTFILE(QTEMP/WOKFILE)
          DETAIL(*FULL) OUTFILFMT(*TYPE1)

Surely I would only want to retrieve the information for enabled profiles, or perhaps have a way to validate if a single user profile is enrolled in the system directory.

After some poking around I found a number of files in the library QUSRSYS that would give me the information I wanted. As the data is in files I can use SQL to get data and format the results in a way I would want, in real time.

Monday, July 18, 2022

Merlin comes to 7.3

When the announcement for IBM i 7.5 was made we were introduced to Merlin. This was made available for IBM i 7.4 TR6 too.

I do not remember there being any mention of Merlin being made available for earlier releases. It appears that I missed something as earlier this month IBM announced that Merlin would be available for IBM i 7.3 too.

For more information you will find the announcement here.

Personally I think this is a great move by IBM to broaden the number of their customers who can use Merlin, as there still are a lot of companies still running IBM i 7.3 on their partitions.

Wednesday, July 13, 2022

Find how to update the long comment column

sql comment on

Those of you who have used the SYSCOLUMNS and SYSTABLES views must have noticed that there is a column called LONG_COMMENT. On the partitions I work on this column is usually null. What is purpose of this column? And how is it updated?

A quick search in IBM's documentation introduced me to the COMMENT ON SQL statement. Before I give examples of how to use it, I am going to need a SQL DDL table to use:

01  CREATE OR REPLACE TABLE MYLIB.FIRST_TABLE
02    FOR SYSTEM NAME "TABLE1"
03  (FIRST_COLUMN FOR "FIRST" VARCHAR(20),
04   SECOND_COLUMN FOR "SECOND" VARCHAR(20))
05  ON REPLACE DELETE ROWS ;
                                                         
06  LABEL ON COLUMN FIRST_TABLE (
07     FIRST_COLUMN  IS 'First               col',
08     SECOND_COLUMN IS 'Column              heading'
09  ) ;

10  LABEL ON COLUMN FIRST_TABLE (
11     FIRST_COLUMN  TEXT IS 'First column',
12     SECOND_COLUMN TEXT IS 'Column text'
13  ) ;

14  LABEL ON TABLE FIRST_TABLE IS 'This is the first table' ;

Tuesday, July 12, 2022

New Power10 Servers announced

September last year IBM announced the first of the Power servers that included the Power10 chips, the E1080.

Today more Power10 based servers have been announced. All of these are smaller than the "flagship" E1080, but still pack considerable power (pun intended).

Click on image to see larger version

I am sure all of my regular readers know that I am "software" guy, not "hardware". Rather than embarrass myself, by not explaining the new servers features properly, I am giving you the links I have found about these new servers.

A big disappointment is that the newly announced E1050 will not run the IBM i operating system.

Wednesday, July 6, 2022

New SQL Table Function for Activation Group information

activation group ACTIVATION_GROUP_INFO

New release IBM i 7.5 and the corresponding Technology Refresh for 7.4, TR6, has given us a SQL Table Function that allows us to see information about the active activation groups within a job. In the past I have been able to get this information using the Work With Job command, WRKJOB:

WRKJOB JOB('*') OPTION(*ACTGRP)

The output options are limited to display ( * ) or printed output ( *PRINT ). For years I have taken printed output from commands and broken them apart into files either using SQL or RPG. It is nicer to have a View or Table Function where I do not have to do this anymore.