I was talking about RPG OA today. If you’re an IBM i techie, then you will know about OA already. You probably understand its power and potential in our IBM-i world. If youre a bit more old school, you’ve been churning out column based code for years, or you are living under a rock in a desert somewhere, or you just don’t know what the hell I am mumbling about – then here is a quick little primer:
Rational Open Access: RPG Edition, which is shortened to RPG OA, was developed by IBM to give us programmers a simple”ish” method to pass data from a RPG program to an external service (for example a web browser).
RPG OA uses a single RPG opcode to let RPG programs, with traditionally limited interfacing capabilities, communicate data from DB2 database tables (5250 display files) with other interfaces that it cannot talk to normally…. this might mean Web services, browsers, mobile devices, XML/JSON files, external databases, and the list goes on.
RPG OA can be easily added to old RPG code in Green screens programs and new RPG programs. OA does not affect functionality of existing DSPF programs, add the line of code, recompile and they will continue to work how they have for years, decades, centuries /insert maniacal laughter
Without getting too technical — The RPG OA Handler populates a data structure from the data fed into it (for example what is being sent to a green screen) and this lets us extend the existing RPG I/O model to talk to virtually any *internet* device we can think of. More than that, we can even use RPG OA to talk to places on our own machine (ie: the IFS) without using clunky API access.
So, think about this – if we have a program that is writing to a table and we want to get that table data somewhere else. Lets say a file in the IFS. We could write a DB2-IFS handler and then just add that line of the code to any existing program and data would be automatically written to an IFS file as that program writes to the table. Cunning stuff!
The great thing about it is that it’s a simple line of code to add to the DSPF specification on the F-SPEC so existing RPG programmers can quickly add it.
The Handler programmatically determines the amount of data it wants and can make the selection at the time of the open operation.
In other words, pretty much the same as the old SPECIAL file interface but with the addition of full file and record names, key data, etc. A full description of each field (known as a Name/Value handler) along with the data and keys. The description includes information such as: Field name, Length, Data type, Decimal places, etc.
The Handler can pass back full status data to the user program. For example, field values like RRN, Status codes, etc.
Use a “Buffer” handler if:
Use a “Name/Value” handler when:
The more generic a handler is the more complex it is to write. But you can easily write handlers for IFS files, spreadsheets, etc.
IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Alpha Nerd and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and in the words of the most interesting man in the world: Stay thirsty my friend.
What is an RPG Open Access Handler?
MSGGEN048 Error on IBM Client Access Solutions
What is the RPG Open Access Handler all about?
What is IBM i Email and SPF?
Updating Numeric DTAARA in RPGLE
How to capture IBM-i job info for submitted jobs
Register license key in SOFTLANDING SOFTMENU
Going the (Levenshtein) Distance in RPG Free
Don’t hardcode library names in your TURNOVER SQL source #youbigsilly