Gregory Simmons
Gregory Simmons is a software engineer with PC Richard & Son. He started on the IBM i platform in 1994, graduated with a degree in Computer Information Systems in 1997, and has been working on the OS/400 and IBM i platform ever since. He has been a registered instructor with the IBM Academic Initiative since 2007, holds a COMMON Application Developer certification, and was recently acknowledged with a speaker award at POWERUp23 as well as a Level 1 Contributor badge with IBM. When he’s not trying to figure out how to speed up legacy programs, he enjoys hiking, backpacking, SCUBA diving, hunting, and fishing.
-
Guru: RPG Receives Enumerator Operator
November 11, 2024 Gregory Simmons
The RPG language now (some would argue, finally) has an enumerator operator. This was introduced in IBM i 7.5 TR3 and IBM i 7.4 TR9.
DISCLAIMER: The edibility of the mushrooms listed in my test program are purely to give the program some context and make it interesting. Their edible status is based on information from the Missouri Department of Conservation’s publication A Guide to Missouri’s Edible and Poisonous Mushrooms. Before foraging for or consuming any wild mushroom do your research and be safe.
Let’s dive right into a code sample. We’ll start with a simple linear-main program …
Read more -
Guru: RPG Select Operation Gets Some Sweet Upgrades
September 23, 2024 Gregory Simmons
I have always been a fan of RPG’s Select operation. Any time I’m coding an If statement and think there’s a chance that there could be a third situation other than the If-Else conditions, I will go ahead and code the Select operation instead of the If statement. The RPG language’s Select operation got a pretty sweet upgrade in V7R5 TR2 and V7R4 TR8. Now, the Select statement can be presented with a value and we have two new op-codes to use within the Select operation; When-is and When-in.
DISCLAIMER: The edibility of the mushrooms listed in my test …
Read more -
Guru: Growing A More Productive Team With Procedure Driven RPG
June 24, 2024 Gregory Simmons
There are many great benefits to procedure driven RPG, and I have covered many of them in my previous articles. In this article, I want to share with you what I believe is the biggest benefit to implementing procedure driven RPG in your shop; procedures, when written and implemented properly, are reusable.
When you’ve written a new procedure that expertly tackles one task, you should be proud of the accomplishment. But don’t keep that in your program. Export it in a service program for your whole team to use! Now, undoubtedly, you will find yourself at one point thinking: “Yeah, …
Read more -
Guru: With Procedure Driven RPG, Be Precise With Options(*Exact)
June 3, 2024 Gregory Simmons
Introduced to the RPG language in V7R2 TR1 and V7R3 TR7, the Options(*Exact) enables RPG programmers to adopt a more defensive coding style. Defensive coding is something all developers should be practicing.
DISCLAIMER: The edibility of the mushrooms listed in my test program are purely to give the program a little context and make it interesting. Their edible status is from the publication by the Missouri Department of Conservation called A Guide to Missouri’s Edible and Poisonous Mushrooms. Before foraging for and/or consuming any wild mushroom, do your research and be safe.
**Free Ctl-Opt Main(Test_Exact_Options); Ctl-Opt Debug Option(*SrcStmt:*NoDebugIO);
… Read more -
Guru: Testing URLs With HTTP_GET_VERBOSE
May 20, 2024 Gregory Simmons
In my previous article Fooling around with SQL and RPG, I explored having a little fun with the HTTP_GET function to fetch a witty Dad Joke from https://icanhazdadjoke.com/. In this article, I want to demonstrate a more practical use of this great function. Or should I say, another version of HTTP_GET, that is HTTP_GET_VERBOSE, which also was introduced to us by the DB2 team in V7R3.
In its simplest implementation, I can insert the URL I want to test into an SQL statement:
select * from table(QSYS2.HTTP_GET_VERBOSE('https://icanhazdadjoke.com/',''))
I will later want to run this embedded in an RPG …
Read more -
Guru: Fooling Around With SQL And RPG
April 15, 2024 Gregory Simmons
Editor’s Note: This was originally scheduled to be published on April 1. No joke. And for a lot of complex reasons, that could not happen. But, it’s still fun, so enjoy.
I started out one morning, purely interested in having a bit of fun. Honest. In RSS within ACS, I often like to run this SQL:
select * from json_table( QSYS2.HTTP_GET('https://icanhazdadjoke.com/', '{"header": "Accept,application/json", "sslTolerate":"true"}'), 'lax $' columns ("joke" varchar(200) CCSID 1208) )
Okay, that was fun. This is harmless, good fun. But then I thought, what if I put this into a simple RPG program? Then I …
Read more -
Guru: Procedure Driven RPG And Adopting The Pillars Of Object-Oriented Programming
February 19, 2024 Gregory Simmons
The four pillars of object-oriented programming (OOP): abstraction, encapsulation, inheritance, and polymorphism, were not created at a single point in time. They evolved gradually over several years, with contributions from various researchers and programmers. Here’s a brief overview of their evolution:
-
Abstraction:
- Alan Kay is credited with introducing the concept of abstraction in the 1960s with his work on Simula.
- Abstraction gained further traction with the development of Smalltalk in the 1970s.
-
Encapsulation:
- David Parnas, in his 1972 paper “On the Criteria To Be Used in Decomposing Systems into Modules,” laid the groundwork for encapsulation by emphasizing the importance of
-
-
Guru: Getting Started With The Code 4 i Extension Within VS Code
January 22, 2024 Gregory Simmons
The Code for IBM i extension is growing in popularity and has certainly become my favorite source code editor. This article is not an attempt to convince you to drop RDi and switch to VS Code. Rather, I aim to share with you a few of my favorite settings and features in VS Code.
Join In The Discussion
Can’t figure out how to do something? Have a suggestion for a new enhancement? I am continually impressed with the speed at which I get responses when I post something. The team of coders and contributors to the Code for IBM i …
Read more -
Guru: Procedure Driven RPG Means Keeping Your Variables Local
November 6, 2023 Gregory Simmons
One of the things I love most about procedure driven RPG is that it allows me to keep my variables locally defined. Imagine this horror story that happens all too often in RPG shops.
Jake: “Hey Gregory, Accounting just called; seems the rebalancing report program is acting up. Didn’t I hear you were working on that the other day?”
Me: “Ugh, yes. All I had to do was reset this field that was used to show or not show the totaling line between branches. I tested in my library and the fix worked fine.”
Jake: “Yeah, I had to change …
Read more -
Guru: Procedure Driven RPG With Linear-Main Programs
September 11, 2023 Gregory Simmons
A number of years ago, I started migrating away from writing subroutines and started writing procedures instead. Yes, quite often, this was simply because it was “new and shiny” and served no real benefit from their subroutine counterpart. However, as the language and I evolved, I found that my method of approaching every project was what I call procedure driven RPG.
Let’s have a look at a simple RPG program. In this little program, to give it a purpose, I’m going to have a little fun with math and demonstrate the Fibonacci sequence:
1 **Free 2 Dcl-s i Uns(3) Inz(3);
… Read more