The following PowerUp blog entry was written by Brian Lannoye, who has been a programmer on the IBM i platform since June 2010 at Masters Gallery Foods in Plymouth, Wis. He earned an Associate of Applied Science degree from Gateway Technical College in Kenosha, Wis., studying under Jim Buck in the programmer/analyst program, which trains students specifically for the IBM i. Before his IT career, Lannoye worked as a truck driver locally and over the road.
RPG was not my first programming language. Before RPG I learned Visual Basic and then Java. So when I was introduced to the IBM i my reaction was, “What is this? Do they still use code like this?” However, after working with RPG regularly, I have really grown to love it. Why, you ask?
For starters, RPG is a self-documenting language that uses real words instead of symbols. OR is OR, not ||. And is And, not &&, = means equal and copy me too. None of the cryptic “for (int i = 1; i==10; i++) { } . Yeah, it’s cool to be able to say you can understand C++ but try staring at it for eight hours a day. It has to wear on your brain after a while.
Also, is there another language out there that has faster, easier access to a database than RPGLE? If there is, I am not aware of it. Let’s get something straight. I don’t want to have to create a connection object, a command object, write error code if the connection fails and then wait for my application to finally pull the data into a result set. Ffilename UF K Disk Setll Chain Reade and you’re done. Thank you RPG. Even the SQL is easy to build. An Exec SQL here, and a Fetch Cursor there and you’ve got some data to work with.
Finally, built-in functions and opcodes take the tedious work out of RPG and make it a fun language to program in. From the conversion functions like %dec () and %editwrd() to array indexing and data structure overlays, if it involves a business function, it can be done in RPG without too much hassle. Sure, other languages have built-in functions too, but does a richer set of tools exist than those in RPGLE?
In short, between the common sense syntax, the ease of database access and the rich set of built-in functions, RPG is a great language for getting a good look at your data. Of course, I’m relatively new to programming and I’m not saying I only like RPG. I’m just pointing out some of the benefits I have observed while working with it.
Brian, you nailed it on the head! Great summary of RPG's benefits from a new-comers perspective. Let us know what else you discover as you continue your journey. Another one of the treasures, IMO, is the library list functionality of IBMi.
AaronBartell.com
Posted by: Aaron Bartell | August 03, 2011 at 09:06 AM
I don't agree when it comes to the "rich" set of bifs. It is the minimum with which you can work at all. I don't know any programming language which has less functionality than RPG (though in other languages you get more functionality through additional libraries/service programs, not bifs).
Mihael
Posted by: Mihael | August 05, 2011 at 01:02 AM
Excellent summary of RPG's features.
People like me who have being programing RPG for a while sometimes take this kind of things for granted. It is good to have someone new to the language remind us of how RPG and the i have helped us developed great business applications using half the complexity.
One last message to Brian: Just wait and see what you can do once you go to the web using nothing more than RPG and HTML.
Jorge
Posted by: Jorge | August 10, 2011 at 10:09 AM
@Mihael "though in other languages you get more functionality through additional libraries/service programs, not bifs"
Please, don't forget CGIDEV2 functions to get real web RPG programs: www.easy400.net
Posted by: Jean | August 11, 2011 at 01:33 AM
Love My RPGLE!! Including FREE!
Posted by: JW Densmore | August 12, 2011 at 05:43 AM
Yes, RPGLE is cool, but try to find a job programming. I have seen too many of my co-workers laid off, and unable to find work.
Posted by: RPG Programmer | August 12, 2011 at 06:14 AM
Here's another benefit we've always taken for granted in RPG (since the beginning):
Errors are errors. They're not invalid page faults, general protection faults or fatal exceptions. They're just errors. This is more of a testament to the operating system, but isn't it easier dealing with a "file not found" or a "decimal data error" than some 300,000 character hex code followed by an invitation to call Microsoft support ?
Posted by: Chris Burns, Sr. | August 12, 2011 at 06:37 AM
RPG really is a beautiful language... and its still evolving with new BIF's appearing in each release (c'mon IBM chaps - give us some /freeformat 'D' specs). RPG's come a long way since the good old days of Logic cycle and program described file layouts.
Thumbs up for an interesting article with a fun, positive spin.
Cheers!
Posted by: Nick Litten | August 12, 2011 at 10:22 AM
Chk out a language called Dataflex (Visual Dataflex, for the GUI people). Faster, and better than any other. VB is still my favourite - recently wrote a conversion pgm to convert VB to RPG (RPGIII) and SO easy to convert; bet easier for RPGIV. Do Java, but believe it (like C), is for people who think in hexadecimal. In short - use the best tool for the job. RPG isn't the ONLY tool on the 400, but generally one of the easiest and best for business pgms.
Posted by: Tiger | August 16, 2011 at 03:31 AM
>Yes, RPGLE is cool, but try to find a job programming. I have seen too many of my co-workers laid off, and unable to find work.
I'd be curious to know what knowledge base the RPG programmers had. If they only knew how to do green screen programming, and if the company was moving in the direction of web, then the company had justification of laying them off - their services were no longer needed - what was the company supposed to do? Information Technology is a VERY fast paced industry and it isn't for those that prefer to stop learning. I review resumes on a regular basis and I quickly pass over those that don't have hints at trying to stay modern and up to date. We as RPG programmers aren't entitled to a job/company/paycheck just because we have been there for 20 years!
>In short - use the best tool for the job.
I've grown to HATE this phrase because it gets used in terrible contexts. People jump ship to other technologies/languages/platforms very quickly simply because they couldn't get something in RPG to work the first time they tried it. Instead the phrase should be something like this:
"After realizing where your company has invested millions (i.e. RPG/DB2/IBMi), pursue to great extent to use those technologies over any other so the investment is not lost". So many IBMi shops have lost their investment the past 10 years because of lack-luster RPG staff that didn't stay on top of things and didn't know how to fight off the Microsoft KoolAid drinkers.
AaronBartell.com
Posted by: Aaron Bartell | August 18, 2011 at 10:38 AM
what???? RPG IS a good language......CRAP will not be flipping burgers anytime soon then........ ;> great observation and application of what Mr Buck has taught! kudos Mr Buck
Posted by: david andruchuk | August 25, 2011 at 03:54 PM
@Jean: Come on. CGIDEV2 is just one little project. Now compare it to the functionality you get with Java and the dozens of web libraries out there for Java.
You will probably argue now: "Oh yeah, but that is Java ..." ... and so what? RPG has a longer history than Java and has much less to offer.
Posted by: Mihael Schmidt | August 27, 2011 at 10:54 AM
Brian,
It's quite clear you've been brainwashed into believing that RPG is a really really good language.
I do not go into discussion.
No use.
But take my advice.
Learn Java, learn HTML, learn ....
Do NOT just keep on plugging on with DDS and RPG, although at this moment you can do what you're expected to do on your current job.
Ok... one thing.
In Java (for example) you DON'T HAVE to create a connection string, a command object etc to read one record...
You really don't.
A REAL programming language (e.g. Java) has the contructs to program you're connection object etc and all supporting code (maybe takes a couple hours) only once, and which can be used for all record accessed, using a simple method call (like one chain). With all you're specific functionality if you wish, instead of being forced to use the built-in (and therefore fixed functionality) "chain" opcode.
I really hope you're not trying to convince you're management that green screens have soooo much advantages etc. Because then (if not already) you won't be taken seriously by management, and won't get the chance to learn new techniques (on your boss's time).
The RPG programming landscape (the tools etc) is like a desert, compared with the jungle. The latter is also not ideal, but you have more chance to find food and survive (or get eaten if unlucky). If you stay in the RPG desert, you wont have a programming future long. Do NOT listen to all those long time RPG hack who have a long experience with ALL languages, being RPGII, RPGIII, and maybe even RPGIV.
Try investing in knowledge that is transferable, i.e. knowledge that is not tied to one specific programming language. Like how to structure and organize code into modules. Encapsulation, modularity, that kind of thing. Learn how to use serviceprograms.
Posted by: john | September 06, 2011 at 07:56 AM
John, I stand by what I wrote. RPG is a great language for getting a good look at your data, and if I did learn another language, it wouldn't be some C++ ripoff like Java. What's the saying? Write once, debug everywhere? Don't get me wrong, you pay me and I'll write any language you want. But I'll put RPG's access to a database up against Java any day.
Posted by: Brian Lannoye | September 10, 2011 at 05:54 PM
Brian I'm glad you like RPG, but forgive me for saying it, but you have had it Sooo easy.
Just try coding in the earlier language versions.
RPGII is incomprehensible gobbledegook that positively encourages poor programming.
RPGIII/RPG400 is an improvement, but it still has truly rotten features that make it difficult to write good, readable code.
RPGIV arrived far too late, which is such a pity.
What were IBM playing at when they kept such antiquated rubbish as RPGII/RPGIII going for so long?
Posted by: David Fisher | March 12, 2013 at 10:53 AM