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

Lets look at an example RPG program talking to a webservice As an RPG Programmer you are probably writing a ton of code to talk to remote webservices out there in internet land. If you are just learning webservice programming, it can seem like a daunting exercise. So, to help you with your first steps

Read More

Are you still running the archaic WDSC7? So we already agree that using WDSC for IBM i software editing, for free, is pretty cool. But, adding Turnover V100 to it, so you can do everything from one place is even cooler. Once we have added the Turnover perspective to our existing WDSC7 setup then we

Read More

Example RPGLE web service program [SOAP] Here is a quick little example RPGLE web service – it’s written in RPG, the SQLRPGLE flavor and simply reads a file (the System/21 Stockroom master file — INP20) and returns a multi-occurrence data structure (array) of the stockrooms that the user is authorized to use. #hopeithelpssomebody WEBGETSTR –

Read More

RPG CODE EXAMPLE – “Write to joblog” Write to joblog lets us send messages from inside a running RPG program. It’s simple using one of IBM’s API’s – Qp0zLprintf I’ve used this little technique for ever. Simple define a procedure calling the API (in this example I call it “writejoblog”) and then in your mainline code

Read More

THE AID BYTE IS A SINGLE CHARACTER FIELD THAT CONTAINS A HEX CODE THAT WILL TELL YOU EXACTLY WHAT THE USER PRESSED ON THE SCREEN – IE: ENTER OR PF3 OR PF12 OR ‘WHATEVER’ The File Information Data Structure is has all kinds of very cool information stored in it. It makes any programmers life

Read More

JULY 2015 Update: I bit the bullet and bought IBM Rational Developer RDi a while ago. It’s a nice step up from the old WDSC client and it deffo runs faster, smoother and supports all the new opcodes that are being introduced to RPG over recent years. I highly recommend RDi to each and every RPG

Read More

IBM Rational Developer for i is my preferred RPG code development tool. Also called R.S.E., Rational Developer is expensive but I can reluctantly argue that its worth the cost to access all the latest and greatest enhancements to the evolving RPG language. Now, saying that, if you are just contemplating moving away from the old

Read More

Any program can easily find out the mode it is running in by calling an IBM supplied *API – which will return the status of the job we are running. Basically, we just have to teach our program to shout “Hey Dude – am I running in batch or what?” and then the dark lord

Read More

What is a load all subfile? A load all subfile is one in which we generally specify the subfile size as 9999 in the record format itself. However, you may define the subfile size to be less than 9999 in the record format and still load all your subfile at a time. In that situation

Read More