Wednesday, October 29, 2014

Subroutines versus Subprocedures

The differences and advantages of using subprocedures rather than subroutines in your RPG code

I was at a presentation given by Partner/400's Susan Gartner and Jon Paris where, amongst many things, they discussed replacing subroutines in your RPG code with subprocedures.

Having spent the last few weeks using subprocedures in place of subroutines in any new programs I have written, I have been won over to the subprocedure side of the argument.

Let me clarify this post is not about taking code from an existing program and placing it in an external procedure. It is about the differences I found using in-line subprocedures when compared to in-line subroutines. So what were the major differences I found?

Wednesday, October 22, 2014

Three CRTDUPOBJ myths busted

3 examples of how ti use CRTDUPOBJ command

I am writing this post in response to several comments that have been made on posts in this blog, discussions threads I have seen in Facebook, and discussions I have had with work colleagues.

The Create Duplicate Object command, CRTDUPOBJ, is used to create a duplicate any object, not just files. But in this post I am just going to cover what I call "data files", physical and logical files.

The myths I have recently encountered are:

  1. You have to give the from library name.
  2. If there is a trigger on the from file when it is duplicated the trigger is on the new file too.
  3. If you duplicate a physical file to another library and then duplicate a logical file that is built over the original physical the new logical still dependent upon the original physical file.

Monday, October 20, 2014

IBM i VUG in hiatus, not dead

ibm i virtual user group not dead

There have been no updates to the IBM i Virtual User Group since May of this year, and I have been concern that the group had "died".

After several unsuccessful attempts to make contact with the VUG via their web page, I decided to email Steve Will, Chief Architect of the IBM i operating system, and ask him the status of the group. Below is his reply.

Simon, I got the chance to ask this question to Alison Butterill. She tells me the person who was responsible was an IBMer who is no longer with IBM. She's in the process of looking for a leader -- it could be someone outside IBM, too, since this is really intended to be a User Group.

It’s good news for all of us, and I hope the VUG will be active again soon once a new leader is found.

Wednesday, October 15, 2014

How I code source for SQL DDL tables

create sql table ddl using runsqlstm

I received a message from KaBrito about the post Defining SQL tables using a reference file.

Question: How would you do that in some type of a Source Control Management application?
Promote the table to production and then run the Alter table command?

With the move from DDS files to SQL DDL tables this is going to become a frequent asked question.

Monday, October 13, 2014

Modern Developers article from IBM Systems magazine

There are times I find an article or post in another publication that I think is worthy of a mention on this blog. One of these is the article "Modern Applications Start with Modern Developers" that was published in the IBM Systems Magazine special on "Enterprise Modernization", October 2014.

The authors, Jon Paris and Susan Gantner of Partner400, make an excellent case of why you should use the latest RPG:

Wednesday, October 8, 2014

Multiple levels of data compression in save commands

AS400 IBM i data compression rates to a save file

Something that was added to the SAVOBJ and SAVLIB commands in IBM i release 6.1 V5R4 was the ability to compress data more than before when saving to a save file. Previously the only options that were available for the Data Compression parameter was *DEV, *NO, and *YES. With 6.1 V5R4 three new compressions levels were added:

  • *LOW
  • *HIGH

Note:  These three values are not valid when saving to tape.

What is the benefit of using any of these Data Compression values?

Monday, October 6, 2014

7.1 TR9 and 7.2 TR1 announced

Technical Updates IBM i 7.1 TR9 and IBM i 7.2 7.2 coming soon

The new Technical Updates for the latest two releases of IBM i, 7.1 and 7.2, will be available on November 11, 2014.

TR9 for 7.1 includes updates to:

Thursday, October 2, 2014

Defining SQL tables using a reference file, continued

sql create table like

Yesterday I showed how to create SQL tables using a reference file. Tommaso Arcieri message me with another approach, defining a table based on another file or table.

In this example I am going to use the physical file TESTFILE as the original reference file.

  A          R TESTFILER
  A            FLD001        10
  A            FLD002         3P 0
  A            FLD003        10
  A            FLD004         5P 0
  A            FLD005         9P 2
  A            FLD006         7P 2
  A            FLD007         1
  A            FLD008         1
  A          K FLD001

This just a small file of only eight fields, so it would not be a big deal to enter each field name. But for a field with many more fields it would be a pain to do so. Fortunately the approach Tommaso showed me should be used if the original reference file has only one field or hundreds.

Wednesday, October 1, 2014

Defining SQL tables using a reference file

reference file, create table, alter table, label on column, label on table

I am old enough to have been working with IBM midrange computers before the introduction of the AS400 in 1987, see 25th anniversary of IBM i (AS400). Twenty six years ago I was a programmer on the System/36 using RPG II. I can remember the first day I started programming on the AS400 how I was blown-away by the relational database, which was not present on the System/36. The files I created could refer back to a reference master file, and I would no longer have to worry about ensuring that all the invoice number fields were the same size, etc.

With the modernization drive to replace DDS files with SQL tables how do I do the same as a reference file in SQL. All the examples I have seen show the DDL (Data Definition Language) for the SQL tables where the data type and size of the columns (fields) have been defined. In my opinion this is a step back from the beauty of the relational database.

So how can I use a reference file in SQL?

I could use the method I described in the post Creating a SQL table on the fly, but there must be a better way.