Copybooks and subprograms

COPY and COPY REPLACING put one record in two programs; CALL and USING then pass it between them in the three parameter modes. RETURNING and RETURN-CODE carry the status back, and INITIAL, EXTERNAL and CANCEL decide what a subprogram keeps between calls. The part ends on a copybook both sides check and on the link line that builds the modules.

088 COPY and copybooks a copybook on disk, COPY, the extension the compiler searches, and one record in two programs Open 089 COPY REPLACING ==pseudo-text==, a record under another name, and the limits of the replacement Open 090 CALL and USING CALL "SUBPROG" USING, a subprogram with a LINKAGE SECTION, and the value that comes back Open 091 BY REFERENCE, CONTENT and VALUE the three modes, what each passes, and a callee that changes its parameter Open 092 RETURNING and RETURN-CODE RETURNING, RETURN-CODE, and the status the caller reads after the call Open 093 INITIAL, EXTERNAL and CANCEL IS INITIAL, EXTERNAL, CANCEL, and the state a subprogram keeps between calls Open 094 Nested programs and ENTRY END PROGRAM, an ENTRY point, and a CALL by entry name Open 095 A copybook-driven interface one copybook shared by caller and callee, a version field, and a contract both sides check Open 096 Building modules with cobc -m and -c -m for a module, -c for an object, and the link line that puts them together Open

Lessons