Three approaches that would normally be used are macro, a copy file, and LOCTR.
Many would avoid a copy file if the source has to be placed in a separate part
because it can be harder to maintain.
But if multiple modules want to be able to include this same code, macro and
copy file are the way to go.
Here's a simple example with LOCTR
TEST CSECT
MAIN1 LOCTR
M1 DS F
SUBR LOCTR
MAIN2 LOCTR
M2A DS F
SUBR LOCTR
S1 DS F
MAIN2 LOCTR
M2B DS F
END
The order of instructions in the OBJ will be M1, S1, M2A M2B
Peter Relson
z/OS Core Technology Design