Friday, October 27, 2023

Updated Power 10 performance guide published

On Wednesday Steve Will, IBM's CTO and Chief Architect for the IBM i operating system, announced on social media that an updated version of the "IBM Power 10 performance optimization for IBM i" had been published.

The timing could not have been better as the company I work for is installing their new Power 10 server next week.

I have read the guide and am impressed with all the advice that is offered.

You can reach the guide by using this link here.

Thursday, October 26, 2023

Renaming a CL procedure's name in a RPG program

One of my criticisms when using CL procedures in my RPG programs is that I had to use the name of the module. Sometimes the ten character name of the procedure, and module, was not descriptive enough for my sensibilities. I have discovered that a solution was provided in IBM i 7.2 that allows me to give my own name to CL procedures.

In this example what the code for the CL procedure is not necessary. All I need to know is that it will copy a file to a IFS folder. It has four parameters:

  1. Library the file is in
  2. File name
  3. Path name, directory and name the file will be called in the IFS
  4. A code returned from CL procedure to whatever called it

Wednesday, October 25, 2023

Calculating the sine, cosine, and tangent

I was asked what is the best way to calculate the sine for a number within a RPG program? I know my answer frustrated the person who asked as I replied with "It depends".

I can think of two scenarios that I would use different approaches for:

  1. Calculate the sine for a value in a file or table's field or column when "reading" the file or table
  2. Calculate the sine for a value calculated within a program

In my examples I am going to also show how to calculate the cosine and tangent too.

Wednesday, October 18, 2023

Using the time zone UDF I created in RPG

Yesterday I showed how to create a SQL User Defined Function, UDF, to return the current timestamp for another time zone.

Several people messaged me asking me how I would use this in a RPG program. Rather than answer them individually I thought would share my answer with you all.

I could think of two examples of when I would use the THEIR_TIMESTAMP UDF in a RPG program:

  1. I want to retrieve the timestamp from the UDF into a RPG variable, that I can then use elsewhere in the program
  2. Use it as part of an SQL Insert statement into a DDL Table or DDS file

Let me start with the first scenario: retrieving the timestamp from the UDF into RPG variables:

Tuesday, October 17, 2023

Determining the time zone with a user defined function

In a previous post I wrote about calculating the time in different places in my IBM i partition. I mentioned at the end of that post that I had created a User Defined Function, UDF, to perform that calculation for me. This post is to show you how I did that.

As I described in the previous post I can calculate the UTC by using the CURRENT_TIMEZONE special register:

UTC time = CURRENT_TIMESTAMP – CURRENT_TIMEZONE

It is not possible to know what other time zone's difference is from UTC without using a table to contain the following information:

Wednesday, October 11, 2023

More information about the Fall 2023 TRs

Information is still coming out about the Technology Refreshes announced yesterday.

Steve Will, Chief Architect for IBM i, gave his take on these in his "You and i" blog, you can read that here.

IBM has worked with COMMON North America to share two videos about these TRs:

You will need to register for both of these recordings. It requires a COMMON North America profile to do this, which is free to create.

I am still looking out for anything else I can find out about these TRs that I will share with you on this page.

Tuesday, October 10, 2023

Fall 2023 TRs announced

Today is the day that IBM has announced the Fall 2023 Technology Refreshes for the currently supported releases of IBM i, 7.5 TR3 and 7.4 TR9.

All the information about the TRs can be found on IBM website on the following on the following pages in IBM's websites:

Wednesday, October 4, 2023

Determining the time zone, and calculating the time in another country

I was asked if there is a way to calculate the current time in Japan, in an IBM i partition in the USA. To add to the complication in doing this the use of Daylight Savings Time, DST, has to be handled. Most places in the USA observe DST, not all other countries do.

Every IBM i partition has a set of system values that are related date and time. Two of these are particularly relevant here:

  • QTIMZON:  Time zone
  • QUTCOFFSET:  UTC offset, hours and minutes different from UTC. UTC the same as GMT, Greenwich Mean Time

I can retrieve these two system values with a SQL statement using the SYSTEM_VALUE_INFO View: