Jonathan, all, I used OPSYN on DS, DC, EQU (and a lot more) to do something pretty close to this. That set of macros enabled me to modify the expansion of IBM-provided mapping macros without needing to change them in any way.
I am convinced that this approach could also be used to achieve the goal of the OP, which should be a lot easier than all the hoops and loops I had to jump through to get the macros to work with literally any set of DC/DS operands... The source code is available in CBT file 884. (for those curious enough to have a peek). Kind regards & happy programming, Abe Kornelis ========== On 20/06/2025 11:46, Jonathan Scott wrote: > You'd be amazed at what can be done using OPSYN to intercept DC, DS, ORG and > EQU! I've previously written tools to support "object oriented" assembler > "class" definitions where the data definitions are mostly just ordinary DC or > DS and can even include IBM macros. Remember also that DC within a DSECT is > treated quite similarly to DS, which helps. If the class definition is > copied into a module which is not the "owner" or a "friend" as listed in the > class header, all private variables and methods are automatically made > anonymous or renamed to internal names so that they cannot be referenced > within that module. But admittedly that stuff was very tricky to set up and > it took a lot of work to make it sufficiently reliable, robust, > well-documented and maintainable to be suitable for official product code, so > it's not really a quick solution. > > If you have multiple instances of some structure, perhaps including initial > values as well as dynamic copies, I would recommend that rather than defining > prefixed labels for each instance it would be much better to use anonymous > fields except for the standard DSECT then to use qualified USING statements > to refer to the fields in each copy as required. > > Jonathan Scott > > > > >