Let’s look at a quick little example RPG email validation program – SQLRPGLE ILE There are lots of code snippets, example programs, and long waffling discussions in internet land filled with pointy-headed AS400, Series, and IBM i programmer chaps (and chappettes) arguing about the best way to “validate an email address in RPG”. I know

Read More

Fun with RPGLE Strings I was emailed a little IBM i programming question this morning: An input parameter @Account is a 100 character string for one to x number of 8 digit accounts separated with a comma (,). Each account can be entered with commas between each account. Example: The string @Account could be “123,00574,

Read More

Talking to a colleague this morning, we were discussing a vendor supplied series of spreadsheets (in CSV format) that his team needed to process. “What’s the best way to read all the spreadsheets in an IFS folder so we can process them?” bald bloke in the office Well, we have a nice simple technique to

Read More

This morning I had an email from a blog subscriber ( Hi Rick! ) asking for a code tips on how to cleanup IFS file names to remove erroneous characters and/or malformed directory name slashes. Rather than reply with a plethora of programming options — here is an old, but functional, RPG code snippet that

Read More

AKA – writing a new DSPLY opcode that shows more than 52 characters Using the DSPLY opcode to quickly debug a program has long been a staple of us RPG keyboard whackers. The DSPLY operation lets us “display the data in a variable” onto the screen. Everyone uses this quick and dirty technique and everyone

Read More

I wanted a handy little RPG code snippet to return the day name for a date. My requirement was to  feed in a date like “Nov 30 2017” and it to tell me that its ‘Thursday’. Google to the rescue, I found a nice little article by RAFAEL VICTORIA-PEREIRA (Thankyou Sir!) which has a code sample

Read More

While I was writing that previous blog about handling wide fat screens I stumbled across another useful API (QSNRTVMOD) for retrieving the current screen mode that we are displaying. This means we could find our screen width programmatically. Why isnt that a word? I’m not too sure why anyone would want to do this but…

Read More

I was having a mini-rant earlier about the problems with the old 24×80 screen size. Basically, the newer wider 27×132 is much nicer ( we all know that ) but older 24×80 5250 sessions will get very upset when they try to display a menu or screen that is designed at the 132 characters wide

Read More

IBMi Control Language, Templates and Subroutines Control Language (*CLP) is a wonderful little tool in every IBM i Programmer’s toolkit. Sadly it’s frequently derided, frowned upon and ridiculed by RPG chaps and chappettes. OK, so CL isn’t a full suite business language, but reminds me of learning BBC BASIC back in my school days. I

Read More

Wondering what REXX is? First off, it has nothing to do with those big green lizards that ran around angrily eating other lizards (presumably because their pathetically small arms gave them some kind of appendage envy) REXX is a kinda cool interpretive language — a bit like Control language (CLP). The neat thing about it

Read More

RPG ILE %BIF (Built In Function) I always forget the differences between %EOF, %EQUAL and Not %Found when writing native file I/O in RPG ILE Programs.  Sometimes a file record is %found and sometimes its not. Even after all these years I still scratch my head about which one is which. I know, I know –

Read More

Want to Scan Replace in RPG? In the middle of this RPG program, I want to reformat and replace some values in a big long address field. But for the life of me… I can’t remember how to use the SCANREPLACE built in function in RPG. #Dingbat /me memory circuits need a service methinks. So, like

Read More