Notes

Guaranteed exit code with ON-EXIT

Here’s handy: The ON-EXIT operation code begins the ON-EXIT section. The ON-EXIT section contains code that runs every time that the procedure ends, whether it ends normally or abnormally. The ON-EXIT section runs under the following conditions: The procedure reaches the end of the main part of the procedure. The Read more…

By Paul, ago
Notes

Converting to CHAR with leading zeros

This is as much a reminder to myself as anything else because the %CHAR built in function has the unfortunate behaviour of stripping leading zeroes when converting a number to a character value. Sometimes I need to keep those leading zeroes, for example when handling elderly date fields. Fortunately, there’s Read more…

By Paul, ago
Notes

Using the SQL Translate Function

The SQL TRANSLATE function is worth knowing about if you ever find yourself needing to (for example) fix data from an external feed before you attempt to do anything with it. The function requires returns a value in which one or more characters in expression have been converted into other Read more…

By Paul, ago
Notes

Interpreting the DSPPGMREF file usage

I mentioned the DSPPGMREF command a couple of weeks ago. This command allows you to generate a list of system objects used by specified programs and is particularly handy when you want to see which programs are doing what to a specific file. The only quirk is that the file Read more…

By Paul, ago
Notes

On terminology

No, I’m not going to revive the perennial — and pointless — argument about what we call the platform. It’s an IBM Power System running the IBM i operating system and there really is nothing else to discuss here. Beyond this, however, there is terminology that we use which is Read more…

By Paul, ago
Notes

Counting lines in QShell

I have a large number of stream files that need to be imported into a database file so that they can be reprocessed. What makes this fun is that the data processing is quite slow and I have a lot of data to load. Because of this, I need to Read more…

By Paul, ago
Notes

Better impact analysis with DSPPGMREF

The IBM i Control Language (CL) provides such a rich set of commands that even after almost 30 years, I can still discover something really useful. DSPPGMREF is a case in point: The Display Program References (DSPPGMREF) command provides a list of the system objects referred to by the specified Read more…

By Paul, ago