Rules for good coding style I started this with the idea of writing a blog about “Rules for good RPG coding style”, I was discussing this with an old friend and colleague yesterday. He moved away from the AS400 machine, just as it was being replaced with the old iSeries machine. He’s now spent nearly

Read More

Upgraded our IBM i systems to IBM i V7.3 yesterday and so far everything is running nicely except for this one weird little glitch: some of the existing DDS WINDOW SCREENS are bombing with CPF4169 The device file does not contain an entry for screen size when they seem to have been quietly working for years,

Read More

While I was writing that previous blog about handling wide fat screens I stumbled across another useful API (QSNRTVMOD) for retrieving the current screen mode that we are displaying. This means we could find our screen width programmatically. Why isnt that a word? I’m not too sure why anyone would want to do this but…

Read More

If there was a quick and easy solution to “how to quickly become a productive RPG IV and ILE programmer” then all of us old AS400, iSeries and IBM I developers would have gobbled up that solution in double quick time. But Wait. There might just be Ne. Drinking Tea. If you have read any

Read More

Modernizing RPG Programs – Learn the RPG History first I had email email from an old work colleague this morning. He was a windows programmer, with limited exposure to RPG, but works in a company that is driven by a huge, old, complex RPG3 application that has changed little over the last decade. He is

Read More

Write Clean RPG Code This morning I was revisiting a program that I wrote last year and looking at my code thinking “Why the hell did I write it like that? #Ugly”. RPG code evolves and lots of code evolution starts in one direction and then branches off, drunkenly in another direction. This means that

Read More

RPG CODE EXAMPLE – “Write to joblog” in Free Format RPGLE Write to the IBM i joblog is a neat way of recording details of any running jobs information. This example lets us send messages from inside a running RPG program. It’s simple using one of IBM’s API’s – QMHSNDPM – and this source code

Read More

RPG CODE EXAMPLE – “Write to joblog” in RPG with Qp0zLprintf Write to joblog lets us send messages from inside a running RPG program. It’s simple using one of IBM’s API’s – Qp0zLprintf Qp0zLprintf() — Print Formatted Job Log DataThe Qp0zLprintf () function prints user data specified by format-string as an information message type to the

Read More

Indicators Suck! So, lets look at two simple alternatives to make your RPG code more readable and easier to understand and modify. (1) RPG Named Indicators When is an RPG indicator more than just a number? We can use a named data structure to overlay over the top of all the indicators used in the program.

Read More

I was talking about RPG OA today. If you’re an IBM i techie, then you will know about OA already. You probably understand its power and potential in our IBM-i world. If you’re a bit more old school, you’ve been churning out column-based code for years, or you are living under a rock in a

Read More

Modern ILE RPG now (finally) supports “fully free form” RPG Source code This means, we can write RPG code from column 1 to the end of the line — just like other languages. No more jumping to character 10 to get passed the old reserved (H,F,D,I,C,O) specification column. You must code **FREE in column 1

Read More

RPG EXAMPLE to read NUMERIC from ALPHAMERIC AKA: how to select only the number from an address in a field, or file data A little while ago, I wanted to extract out the numerics from a string of data: For example (a) if I feed in a phone number like “(540)-123 – 1234” but I just

Read More