Wednesday, November 18, 2020

New RPG features for arrays

%list built in function and for-each operation code for arrays

The new Technology Refreshes, IBM i 7.4 TR3 and 7.3 TR9, has given us a couple of new additions to array handling in the RPG language.

The first is a Built in Function, %LIST, that allows me to fill an array in one statement, and introduced me to a concept I had not heard of in the RPG language before, a temporary array.

The other is an operation code, FOR_EACH, that allows me to read an entire array, one element at a time in a loop operation without having to condition the loop with the number of elements in the array.

Let me start with %LIST Built in Function.

Tuesday, November 17, 2020

Range test added to RPG

%range bif added to rpg

The latest Technology Refreshes, IBM i 7.4 TR3 and 7.3 TR9, have added something I have wanted for a long time added to the RPG programming language, the ability to test if a value is within a range. This has been achieved by the introduction of a new Built in Function, %RANGE, and a new operation code, IN.

The syntax is very similar to the Range test I use in SQL:

if <value or variable> in %range(<minimum value or variable> :
                                 <maximum value or variable>) ;

Let me get on with some simple examples. First with a date:

Friday, November 13, 2020

TR day! 7.4 TR3 and 7.3 TR9

ibm i 7.4 tr3 and 7.3 tr9 day

Today is an exciting day as the new Technology Refreshes, TR3 for IBM i 7.4 and TR9 for 7.3, are now available to download via PTF.

I wrote about what is in these when they were announced in October.

Links to the find the PTFs are:

I am now off to generate a support ticket to ask RZKH to load all of these PTFs. I can then start writing about all of the cool new stuff!

Wednesday, November 11, 2020

Entry plist in all free RPG

entry plist in totally free rpg

This post comes under the category of "I thought I had already written about this". I have written about calling programs with totally free RPG, and how to receive passed parameters to a RPG program with a main procedure, but I just forgot to write about how to receive parameters to a RPG program without a main procedure.

In fixed format RPG the entry parameter list would look like:

   CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result+
01 C     *entry        plist
02 C                   parm                    Parm

Now how do I do the same in free?

Wednesday, November 4, 2020

Getting "Run SQL scripts" to use the library list

change run sql scripts to use library list

Perhaps I am the only person who experienced this issue with my "Run SQL scripts", but I am going to share the solution I found.

I have to say "Run SQL scripts" is probably my favorite IBM i tool. I open it when I start my work day, and I use it all day to help me develop and test various SQL statements before I copy them into programs, procedures, or source members that I then create the objects from using the RUNSQLSTM command.

When the latest release of Access Client Solutions, ACS 1.1.8.5, was released I download the new install files, uninstalled the version of ACS I already had, and ran the install program to install it onto my PC. When it completed and I started to use "Run SQL scripts" again I found that I had to qualify the object, file, view, etc. name with the library. If I did not I always received the message telling me that the object was not found.