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

+Happy New Year 2018. One of my new years resolutions was to write cleaner code, and in the spirit of out with the old and in with the new… I already use the RPG COPYRIGHT statement and the CL COPYRIGHT STATEMENT to store the copyright message and (more importantly to me) the Version or Release number

Read More

It’s not someone that makes door handles is it? In software development a handler is a routine/function/method specializing in working with a certain type of data or focused on doing a special task. For example: Event handler – Receives and digests events and signals from the surrounding system (e.g. OS or GUI) or RPG HANDLER – Send/Receives data from

Read More

Want to Scan Replace in RPG? In the middle of this RPG program, I want to reformat and replace some values in a big long address field. But for the life of me… I can’t remember how to use the SCANREPLACE built in function in RPG. #Dingbat /me memory circuits need a service methinks. So, like

Read More

Substring in RPGLE SQL This morning, I had to make a little change to an RPG4 program to let it respond to a new parameter being passed into it via JSON. This value had to be stored in the first character of a field in a physical file in the database. Simple Logic and we

Read More

I have a NUMERIC in an RPG program that I want to move RIGHT into an Alpha field. In the old days of RPG3 I would use MOVE but in the new days of RPG4 I have a couple of more flexible solutions. So, lets say we have a numeric field containing the number 1234,

Read More

Pointing at Pointers and laughing aka “How to Display Pointer Data” RPG has all kinds of different data types. In the olden days of RPG, we only really thought in terms of character variables and numeric variables (signed numeric and packed numeric).  But as the language has advanced and adopted new technologies, methods of talking

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

Nice Subprocedures with RPG ON-EXIT IBM is adding all kinds of new tweaks to RPG with each new release of IBM i. RPG ON-EXIT is a great example of a neat tweak to the RPG programming language. Last year, IBM quietly introduced a rather neat new function called “ON-EXIT” to our sub procedures in RPG.

Read More

A simple RPG ILE Trigger Program This morning, an old programming chum of mine was chatting to me about writing a program, that would be called every time anything was updated in a given file (table) on the system. This action is very simple in the IBM-i world, using a technique called FILE TRIGGERS. What

Read More