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




 

Reply via email to