It’s a rather old programming language much akin to Cobol but a bit modernized to suite the evolving needs of the OS400 developers. I have a love-hate relationship with it. The IDE, if you could consider it as one, is extremely crude, confusing for novices and can be extremely frustrating to use if someone hasn't shown you how. Keywords and commands needs to be aligned to certain columns in order for the compiler to understand it. In the end you get a fixed-format and seemingly cryptic coding that more often than not results to a convoluted hodge-podge of spaghetti code. Check out the code below and you’ll get the drift.
0051.00 C EVAL HLD_USER = $USER
0052.00 C IF $USER = 'QSECOFR'
0053.00 C MOVE '1' *IN(33)
0054.00 C ELSE
0055.00 C $USER CHAIN EMPLYFL 72
0056.00 C *IN(72) CABEQ '1' END_IT
0057.00 C STS CABEQ 'X' END_IT
0058.00 C EVAL HLD_DEPT = DEPTCD
0059.00 C IF DEPTCD = 'MIS' AND $USER <> 'RICH'
0060.00 C MOVE '1' *IN(33)
0061.00 C ENDIF
0062.00 C ENDIF
0063.00 C MOVE '0' *IN(76)
0064.00 C IF DSP_TEST = 'DSP'
0065.00 C MOVE '1' *IN(76)
0066.00 C ENDIF
There is a way to overcome this problem, it’s a partial solution but quite helpful to improve your code, and I promise to post it on the next blog.
Code maintainability for RPG can very difficult that I’m quite surprised why even today these RPG codes still power the business applications that run on many AS/400 machines. Most banks still has an AS400 running at the back, and I know ATM machines uses an RPG based application for backend processing. On the other side, RPG can be quite interesting to learn. It makes you think, it encourages you to outline your program flow (because its not that easy to follow logic unless you’ve written it or drawn a chart), if wielded properly it can be a very powerful programming language that allows you to do just about anything on an OS/400 platform.
Now the obvious question is, is it worth learning? I can’t really give a good answer for this one because unlike most programming languages this one is very machine specific. You can’t run it on other OS simply because its not implemented anywhere else nor is there an emulator for it. But the bottom line is there is a growing market for new iSeries/AS400 developers. There is definitely a good opportunity for developers, IBM is not abandoning the system and companies are still using it, even Dole Philippines recently purchased one.
I’m fortunate that I’m given a chance to learn and use it. Training alone would cost Php 16,000 per module per person, that’s about a week of training and its not even available locally. On the other hand its also unfortunate that I’m killing my brain cells each Saturday to learn it, hopefully saving enough to last me another week. :D
So there i’ve blogged about whats keeping me busy for 2 months now. I’ll be posting RPG and CL (control language) codes and tips on my next blog. I’m currently working on a project that allows me to manage iSeries user maintenance using an external Windows application. I’ll post codes snippets based on the project to help out other developers that are caught in same predicament as I am. It’s a win32+CL code hybrid that’s quite useful for any iSeries administrator. I feel that I might help someone out there trying to learn the ropes as I am, and making sure that they don’t strangle themselves in the process. :D
2 comments:
you know, i was told by my boss that i can start learning RPG if i want to. but the thought of it just scares me.
LOL!
indeed. its a bit frustrating at first but it does have a few qualities worth learning. plus it drastically increases your "employment" value :D if i may ask ric, whats your job?
Post a Comment