In COBOL and similar mainframe languages, sharing variables between main and sub programs typically involves both: (1) defining variables appropriately (sometimes as GLOBAL or external), and (2) including them in the LINKAGE SECTION for parameter passing. The exact mechanism depends on the language and call method.