Gary,
I'm not sure whether there are any extant solutions.
My tuppence:
Create an XSECT macro that will AREAD source code until you reach a marker.
Have the XSECT macro re-emit all DC/DS/EQU statements (inlcuding a
leading DSECT) while saving them for later re-use.
Then when allocating an instance of your DSECT, call XSECT with the
section-name you assigned
so that it will re-emit all statements it has stored when it was first
invoked with only a label as parameter.
I use OPSYN to replace DS/DC/EQU with my own like-named macros.
Macros DSOVR/DCOVR/EQUOVR are used to store overrides which are
considered when DS/DC/EQU are expanded.
This enables me to override definitions inside IBM-supplied mapping
macros without needing to modify the macros themselves.
E.g. I use overrides to associate bit names with flag values and byte
locations so that I do not need to remember these housekeeping details.
Kind regards & success!
Abe Kornelis
===========
Gary Weinhold schreef op 2-10-2014 18:14:
I am trying to develop a technique to force a DSECT (describing some
private control block of mine) to stay synchronized with the
inline-constant and space-reserving versions of the same control block.
For example, for DSECT ABC with field definitions of
ABCID DS CL4 Eyecatcher
ABCLEN DS AL2 Length of ABC
ABCLVL DS AL2 ABC modification level
ABCDATA DS F Some binary data
ABCL EQU (*-ABCID)
I would like to be able to generate in-line constants:
label1 DS 0F
DC CL4'EYEC'
DC AL2(ABCL)
DC AL2(1)
DC F'0'
ABCL EQU (*-label1)
and space:
label2 DS CL(ABCL)
The DSDC macro generates a labeled DS statements or unlabeled DC
statements depending on &TYPE; its format is, for example:
ABCEYE DSDC CL4,C'ABCD','EYECATCHER',&TYPE
ABCLEN DSDC AL2,(ABCBLKLN),'LENGTH OF THIS CONTROL BLOCK',&TYPE
Although I started work on this with a macro I call DSDC, I was
wondering if I'm reinventing the wheel. Is there a model for this
out there?
Any suggestions are welcome.
Gary Weinhold
Data Kinetics, Ltd.