Wednesday, July 29, 2015

Checking for locked objects in QDLS and IFS

object lock qdls ifs dspdlonam wrkobjlck qp0fptos

In the past week one of my established jobs has started an "object locked" error. After some quick analysis I discovered that the object in question is a file in the QDLS file system. This left me asking myself a couple of questions

  1. How can I see what is locking an object in QDLS?
  2. Can I do the same for an object in the IFS?

Wednesday, July 22, 2015

Data Structures in CL

data structures in CL using defined variables

Data structures have always been a useful part of RPG, especially when returning information from a procedure. In CL I can create "Defined Variables", which are the equivalent of a RPG data structure. This becomes useful when I have a CL procedure that is called by RPG procedure, or vice versa. I will explain that in detail in a future post.

I am sure we have all encountered a situation where a data structure is passed to a CL program, and I have seen many programs were the subfields are broken out into individual variables using the Substring command, %SST. While this is easy if the data structure contains only character subfields, it can get messy if there are numeric subfields as I have to determine the start and end positions while considering the packing of the number.

Wednesday, July 15, 2015

Read operation code extenders

read operations reade readpe readp readc chain and operation code extenders

Operation code extenders on a Read operation in RPG are those letters that are follow the operation code in parentheses. I am sure the two most commonly known ones are:

  read(e) TESTFILE ;
  reade(n) (KeyField) TESTFILE ;

Each one provides a little bit extra functionality that compliments the Read operation. On performing research for this post I found that with free format Read operations a number of additional extenders were added, some are available with only some of the Read operations in V5R4 and later releases.

Wednesday, July 8, 2015

The best way to find what is using all the disk space

disk space rtvdskinf prtdskinf

Almost by accident I have started discussions on how to determine the largest objects on your IBM i server. I have given examples of how:

  • Identify the 250 biggest objects using the DSPOBJD command, followed by a SQL statement, see here.
  • Retrieve the number of deleted records/rows in files/tables, see here.

Wednesday, July 1, 2015

Discovering the number of deleted records in a file

systablestat in qsys2

In last week's post, here, I gave an example of how I determine the 250 biggest objects on my IBM i server. I created the information about the objects by using the Display Object Description command, DSPOBJD, and mentioned if anyone knew of a better way to get the same information to contact me.

Tuesday, June 30, 2015

Today is Leap second day

leap second day time adjustment

Today is a special day for two reasons:

  1. My wife's birthday
  2. Leap second day

A Leap second is one that is added to a day to keep UTC (clock) time synchronized with solar time. As the earth's rotation is slowing these seconds need to be added to keep the two together. Tonight that extra second will be represented by the time 23:59:60.

Wednesday, June 24, 2015

Select the number of rows from SQL's result set

sql select with fetch rows only dspobjd

There are times when I do not want all of the rows/records from a table/file just, for example, the 100 with the largest value in a variable. I could use a "Copy File" command, CPYF, to copy on the first 100, but I cannot sort with a CPYF to select the largest. Fortunately SQL's Select does offer me a way to do this.

Today did not start well as the development server reached critical storage, 93%+ of DASD was being used. After doing some basic deleting and purging of a few files I was not able to lower the percentage of DASD more than 1%, which was not enough. What I need to do was to identify the largest object on this IBM i and determine if they could be deleted or their contents purged. But how to find those big objects?

Wednesday, June 17, 2015

Overriding control block size using SQL

override_table is like ovrdbf but is used in sql

Last week I discussed how to use control block size in the "Override with database file" command,OVRDBF, see here. In this post I am going to introduce the SQL procedure OVERRIDE_TABLE. Unlike the OVRDBF command this procedure can only do one thing, set the control block size for a table/file.

The OVERRIDE_TABLE appears to have introduced in IBM i 7.1 TR7. It is not mentioned in the IBM i 7.1 KnowledgeCenter website, but is in the 7.2 site.

This procedure has only three parameters:

Tuesday, June 16, 2015

OCEAN Technical conference 2015

I have just signed up to attend this year’s OCEAN IBM i Technical Conference on July 17, 2015. I went to last year's and it was great to meet other IBM i professionals from Southern California, the experts who came to give the presentations, and I learned new stuff.

If you are in So Cal I recommend that this is the event to attend. You can learn more about the conference at OCEAN’s website here.

I look forward to seeing you there.

Wednesday, June 10, 2015

Using control blocking to improve database performance

ovrdbf control blocks to speed up copy files

IBM i 7.1 TR7 saw an addition to the "Override with data base file" command, OVRDBF, the ability to set the control block size when performing file I/O. By increasing the control block size I can increase the memory allocated to the file's I/O buffer, which will increase the speed of I/O to the file. The enhancement is to the second element of the "Limit to sequential only" parameter, SEQONLY.

Limit to sequential only:
  Sequential only  . . . . . . > ____        *NO, *YES
  Number of records  . . . . . > _________   Number, *BUF32KB, *BUF64KB...