Re: IBM i - Open I/O (for RPG)
Birgitta,
I'm not privy to the Open I/O specification, but I've always been impressed with how familiar, streamlined, and consistent that RPG's interface has been with traditional WORKSTN, DISK, and PRINTER device types. Depending on the degree to which IBM were to open that interface, we could see regular folks writing specific or generic "drivers" for contemporary and new types of devices, and RPG being used for more types of applications.
The SPECIAL device interface never seemed to gain much traction because it was geared more toward writing specific I/O handlers for just one file and one record format, and was constrained by entry point parameters. The name of the I/O handler was hard coded, using the PGMNAME keyword.
I'd like to see a more robust and extensible interface so that generic I/O handlers could be written for user defined device types. Say that we were able to register a new device type named BROWSER (or any other name) and associate a generic handler with it, such that the RPG compiler knew to call that handler for files referenced by "F" specs and all the regular I/O op-codes.
It would be nice if IBM were to provide a CL command to work with and maintain new device types which RPG programmers could reference on "F" specs. Perhaps the PGMNAME keyword could override the generic (default) I/O handler. Perhaps the the EXTFILE and EXTMBR keywords could override the file named on the "F" spec.
I think an Open I/O interface would need to include the file name, member name, and record name, in addition to the traditional parameters passed via the SPECIAL device interface.
I believe the interface would be more flexible and extensible over time if data structure exports were shared between the RPG program and the I/O handler rather than just program call parameters, since new exports could be added over time as more requirements come to light, without disrupting existing I/O handlers. Adding new data structure exports to bound service programs don't have to change the signature of the service program, for example.
I'd like the interface to include the indicator data structure (INDDS), so that I/O handlers could get and set indicators - pressing the F12 key on a browser could set the appropriate indicator before returning from a READ op-code, for example.
I'd like I/O handlers to be able to update a shared error data structure, and for the %error() BIF to return *on when an I/O handler expresses an error.
The file on the "F" spec would need to be multi-format capable, comparable to display and ICF files, in the case of browser and other UI device types.
I've addressed some of the needs of contemporary UI devices, but it appears to me that an Open I/O interface may have even more potential for enabling RPG programmers to interface with remote databases and other types of data.
I'm hopeful,
Nathan M. Andelin