Notes

Submitting a job as a different user

We are all familiar with the SBMJOB command, but it’s rare that anyone looks beyond the first few parameters. Until you need to. One overlooked parameter is USER which allows you to specify the name of the user profile for the job being submitted. Obviously, you need to have enough Read more…

By Paul, ago
Notes

Querying data queues with QMHQRDQD

Someone recently asked me if I knew of an API that could be used to retrieve the number of entries in a data queue without pulling the entries from the data queue. I didn’t, but a quick search turned up QMHQRDQD.: The Retrieve Data Queue Description (QMHQRDQD) API retrieves the Read more…

By Paul, ago
Uncategorised

30 years of The System

On June 21st 1988, IBM launched the AS/400. This was replaced in 2001 by the iSeries which, in turn, was followed by the IBM i on Power. For 30 years, IBM have managed to deliver a robust platform that delivers exceptional security and a business resilience that you can rely Read more…

By Paul, ago
Notes

LTRIM, RTRIM and Trim Expressions

I have to admit that, when trimming strings with SQL, I tend to just use the TRIM function to strip off all leading and trailing spaces. But the LTRIM and RTRIM functions really do deserve more attention because they have been recently enhanced to support trim expressions. That is, all Read more…

By Paul, ago
Notes

Handling divide by zero in SQL

Division by zero is something that, sooner or later, we all have to capture. For the rest of this post, I am using a small temporary table that I have imaginatively named DIV0. It has two columns, COLUMN1 and COLUMN2 and it looks like this: COLUMN1 COLUMN2 5 0 6 Read more…

By Paul, ago
Notes

Returning data structures from Procedures

This post stems from recent conversation on the subject of prototyped parameters. I always pass parameters as read only (using the const keyword) in order to ensure that no unexpected changes in the called procedure can impact the calling procedure. With this approach, the only value you need to worry Read more…

By Paul, ago
Notes

Combining Counts for multiple tables

It’s surprising how many times you need to know whether a record exists in any one of two or more tables. Traditionally, you would have to check each table individually until you either find a match or have checked every table to confirm that no match exists. Finding myself faced Read more…

By Paul, ago
Notes

On holding jobs rather than job queues

Several months ago, I talked about Debugging RPG Programs in Batch and said that, before you submit your job, you should first hold the job queue. While this isn’t bad advice, exactly, it’s not what I actually do. When I am debugging a job in batch, I will submit it Read more…

By Paul, ago
Notes

Service Programs, signatures and RTVBNDSRC

I have talked about service programs in the past and, at the time, I mentioned that you need a binding source without really saying why. So, to revisit the subject, using the binding language allows you to change your service program without needing to recompile all of the programs that Read more…

By Paul, ago