Open Access--Oh the Thinks You Can Think!

The more we work with Open Access for RPG the more we realize how much more we can do with it. For example, a couple of weeks ago Jon published an article detailing an RPG Open Access (OA) handler that allows entries to be written to a data queue with a conventional RPG Write operation. He mentioned at the time that while APIs such as those for data queues are not particularly complex, they are complex enough that they are not as frequently used as they should be.

Dan Cruikshank, one of IBM's leading DB2 experts, and a fellow member of the Modernization Redbook team, wrote to us after the piece was published. He pointed out that while data queues were an excellent example of how OA can be used to simplify things, the interface to almost any list API could benefit from the development of an OA handler. For example, wouldn't it be nice to be able to process a list of spoolfiles that meet certain criteria by using SETLL to set up the criteria, followed by a series of READ or READE operations to retrieve the data. Dan is no newcomer to using OA to adapt existing processes and has written several articles on database modernization using OA. For an example see his article on using SQL with OA on Developerworks.

The more we thought about Dan's comments the more we realized that he was right. After all, how many programmers do you know who still persist in using the outfile support from IBM i commands rather than use the more efficient and more capable related APIs? Would they be more inclined to abandon their old habits if there was an OA handler available for the API in question that would allow them to process the results with familiar RPG op-codes? We think the answer is yes.

So we've been busily working on a sample OA handler that supports CHAIN, SETLL and READ operations against a simple list. The idea being that the basic principals can be adapted to processing any list--no matter how it is derived. We'll be publishing the related article in an upcoming edition of IBM i EXTRA so you might want to watch out for that. (Editor's note: If you don't currently receive the IBM i EXTRA newsletter, you can subscribe here.)

Note: Comments are moderated and will not appear until approved