Tag Archives for " #example "

Jul 12

Write to joblog messages from RPGLE /FREE – a QMHSNDPM code example

RPG CODE EXAMPLE – “Write to joblog” in RPG4 /FREE Write to joblog lets us send messages from inside a running RPG program. It’s simple using one of IBM’s API’s – QMHSNDPM RPGLE Code Example // SNDMSGLOG1.RPGLE // Simple Program to send message to joblog using QMHSNDPM // Author: nick@nicklitten.com ctl-opt dftactgrp(*no) actgrp(‘NICKLITTEN’) option(*nodebugio:*srcstmt:*nounref) alwnull(*inputonly) […]

More Waffle
Jun 01

RPG example: store webservice reply XML or JSON in IFS

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 on the journey, here is a simple RPG CODE EXAMPLE which […]

More Waffle
Oct 28

Write to joblog messages from RPGLE – easy code example

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 […]

More Waffle
Jul 06

DSPF Function Keys and the Hex AID Byte from the INFDS

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 […]

More Waffle
Sep 13

RPG Evolution, Modernization and Refactoring – Step 4 of 4 – Setting RPG Free

Setting RPG Free Convert RPG from Column to free format So, if we take the code and actually upgrade it to be the current style of RPG/Free we can see all the mainline specs are now written in freeform code style and it looks yummy: h datfmt(*iso) timfmt(*iso) option(*nodebugio) debug //——————————————————————- // system name: fix […]

More Waffle
Sep 13

RPG Evolution, Modernization and Refactoring – Step 3 of 4 – Paroling RPG4

Upgrade RPG4 to use free-friendly code standards If we were using Rational Developer/i software we could do this automatically. But as a manual process its simple, if a little tedious. Basically when we are going to skim through the code and replace all indicators with the modern and preferred %FOUND BIF technique: H debug ***************************************************************** […]

More Waffle
Sep 11

RPG Evolution, Modernization and Refactoring – Step 1 of 4

I’ve recently been writing all my new programs in RPG Free format. Attending RPGWORLD earlier this year, gave me the impetus to finally commit myself to the new and improved style of RPG coding. I’m currently in contract at a shop that still has twenty year old programs running in production, the developers still write […]

More Waffle