PTFs to make it easier to use data structures for subfile I/O
barbara_morris 120000DX5W Comments (2) Visits (4858)
During testing for Open Access, we were reminded of how awkward it is to use a data structure for I/O to subfiles. Subfiles always use the WRITE operation and at least one of either the CHAIN or READC operations, and possibly the UPDATE operation. This requires a *INPUT data structure and a *OUTPUT data structure.
This isn't unique to subfiles; it's a problem for any record that is used for both input and output. But it's always a problem for subfiles. So the RPG compiler PTFs related to open access also include a new feature where you can use a *ALL data structure for I/O to a subfile record, meaning that you can use the same data structure for all your I/O.
Here are the latest RPG compiler PTFs::
Here is an example showing how you can use the same data structure for all the I/O for your subfile record. I was going to show a more meaningful example, but it kept kept getting bigger and bigger as I was adding code that made it necessary to use UPDATE and CHAIN.
Fmydspf cf e workstn sfile(sfl : sflrrn)