MC Press Online

Saturday, Mar 25th

Last updateFri, 17 Mar 2017 12pm

You are here: Home ARTICLES Programming RPG

Programming / RPG

RPG Academy: Debug Done Right - Introducing the ILE Debugger

Rafael Victoria-Pereira

Have you met the “new” ILE Debugger? Forget ISDB. The future of debug is here.

Written by Rafael Victória-Pereira

It’s really hard to write a complete and complex piece of code without a bug or two, so you’re probably no stranger to the Interactive Source Debugger (ISDB) that has served RPG programmers since V3R1. Now that you’re moving into the brave new world of ILE, it’s also time to upgrade your debugging skills. In this subseries, you’ll learn what you need to know to turn your time-consuming pains with ISDB into something more pleasant and efficient with ILE debugger.

Read more ...

Practical RPG: Converting to Free-Form RPG, Part 1

Joe Pluta

Free-format RPG is the future, but getting there is still an adventure.

Written by Joe Pluta

Even the best conversion tools only get you part of the way to free-format RPG; here is the first step of the rest of the journey.

I no longer write programs with fixed-format specifications. In fact, when I do occasionally have to work on an older machine, I confess that I find myself stumbling around a bit with F-specs for files. The other day I had to remind myself how to define a data area. It took a while to get to the point where I was comfortable writing all my code in free-form RPG, especially when it came to display files. But the longest journey starts with a single step, and this article is intended to start you on that path.

Read more ...

Practical RPG: Refactoring in RDi

Joe Pluta

Rational snuck a feature in under the radar that might signal a sea change for the product.

Written by Joe Pluta

What is refactoring, and why do you care?

Refactoring in the broadest sense refers to an intelligent, comprehensive change to your program source. The least complicated example is a simple rename, while a more complex case might involve pulling out all occurrences of a common piece of code and putting that into a callable routine.

Read more ...

RPG Academy: Write Better Code - More on Commenting and Documenting Strategies

Rafael Victória-Pereira

This TechTip will continue to discuss the documentation topic, focusing on the tools that an RPG programmer has available and offering a few tips to help define a proper documentation strategy (even if you think you don’t need one).

Written by Rafael Victória-Pereira

One of my favorite things about “modern” languages is the self-documenting features that most of them have. For instance, Java has Javadoc, a documentation generator from Oracle Corporation that is designed to automatically produce documentation in HTML format from Java source code. The HTML format is used to add the convenience of being able to hyperlink related documents together. The “doc comments” format used by Javadoc is the de facto industry standard for documenting Java classes. Some Integrated Development Environments (IDEs), such as NetBeans and Eclipse, automatically generate Javadoc HTML code. There are a lot of file editors to assist the developer in producing Javadoc source and using the Javadoc information as internal references for the programmer. This made me wonder if we, RPG programmers, had been forgotten by IBM in this regard.

Read more ...

Practical SQL: Field Reference Files in DDL

Joe Pluta

SQL does field reference files, too!

Written by Joe Pluta

In a previous article, I discussed how naming conventions really help in database design and programming, and in so doing I touched upon the concept of the field reference file. Field reference files are an easy way to make sure your data elements are consistent, but I'll bet you didn't know you could use them in DDL as well. In this article, I'll show you how it's done.

Read more ...

Practical RPG: Processing Stream Files, Part 2

In part 1, we processed a directory. In part 2, we process one file in that directory.

joe plutaWritten by Joe Pluta

Stream files are not database files.

While that statement is obvious to programmers, it's not always clear to the greater community. The end users, the folks whose jobs we are supposed to be supporting, use various forms of stream files to store their data, and they don't understand why we can't for example just "use this spreadsheet" as part of our application. And while that's an interesting philosophical discussion, as programmers we sometimes have to simply get things done, and that in turn means taking whatever data the user sent us. I've spent a lot of time over the years importing data primarily from Exceland more specifically from comma-delimited files. Two techniques exist: CPYFRMIMPF and parsing the data in RPG. CPYFRMIMPF is a completely different animal that perhaps can be covered another day. Today, I just want to talk about parsing a stream file.

Read more ...

RPG Academy: Write Better Code - Commenting and Documenting Strategies

Usually, programmers don’t comment their code appropriately, for a variety of reasons: “I don’t have the time,” “My code speaks for itself,” etc. Mostly, they simply hate doing it. Let me try to refute these excuses with practical strategies and tools.

 rafael victoria preiraWritten by Rafael Victória-Pereira

As I’ve said throughout this series, a procedure’s name and parameter list should be enough for the programmer to understand the objective of that piece of code. However, there are times when this is not enough: complex procedures, generic names, uninspired input/output parameter names…and the list goes on and on. The next section of this TechTip will help you in the process of creating proper documentation for your newly created procedures and functions, with a few tips of what you should and shouldn’t do.

Read more ...

IBM i Staff Changes: The End of the World as We Know It?

Another topic that seems to be topping the charts these days is the bemoaning of the retirement of RPG talent. But is it really one of the signs of the coming apocalypse?

david shireyWritten by Dave Shirey

A certain amount has been written lately about all the RPG talent that is getting ready to retire or die and what impact that will have on those of us who are still hanging on. Maybe it all started with a webinar (the recording's available) "Strategies for Overcoming IBM i Skills and Staffing Shortages"  given by Rob Rheault, Director of Application Services, and Marcel Sarrasin, VP of Corporate Marketing and Business Development, at Fresche Legacy. This webinar kicked off a certain amount of discussion in the RPG/AS400 Developers group on LinkedIn under a post by Kimberley Chan.

Read more ...