CALL reaches out to another load module—COBOL tax routine, Assembler date utility, second Easytrieve program. RETURN is how that callee hands control back. The caller's next statement after CALL runs when RETURN completes, unless STOP or abend ends the task. RETURNS on CALL captures numeric status so IF RC NE 0 branches to error PROC. Beginners confuse RETURN with END-PROC: END-PROC ends an in-program PERFORM module; RETURN ends a separate called program. CICS online adds conversational rules—called programs must not drop the terminal task incorrectly. This page teaches RETURN syntax, pairing with CALL, return code conventions, static versus dynamic binding impact, Easytrieve-as-subprogram patterns, and mistakes that leave callers waiting on modules that STOP instead of RETURN.
12345678* In called program (callee): RETURN [return-code] * In caller: CALL TAXPGM USING (GROSS, TAX-AMT) RETURNS RC IF RC NE 0 PERFORM CALL-FAILED END-IF
Exact RETURN parameters depend on release—some forms pass explicit numeric return-code; others rely on RETURN-CODE field conventions shared with COBOL linkage. Consult CALL and RETURN chapters together when integrating mixed-language shops.
| Step | Where | Action |
|---|---|---|
| 1 | Caller JOB/PROGRAM | CALL module USING args RETURNS rc |
| 2 | Callee entry | Process USING parameters |
| 3 | Callee exit | RETURN with status |
| 4 | Caller | Test rc; continue or error branch |
Standardize return code meaning per integration guide: zero success, positive application error, negative system error—or shop-specific table. COBOL sets RETURN-CODE special register; Assembler R15; Easytrieve callee sets field expected by RETURNS. Document contract in comment header both teams maintain. Silent ignore of non-zero rc propagates wrong tax, wrong dates, wrong file status into downstream PUT.
| Verb | Scope | Execution resumes |
|---|---|---|
| END-PROC | PROC module | Statement after PERFORM |
| RETURN | Called program | Caller after CALL |
| STOP | Entire Easytrieve run | Program ends |
| EXIT | PROC or activity flow | Per EXIT rules |
USING lists fields or literals passed to callee. Layout must match linkage section on COBOL side—length, order, type. Easytrieve packed versus zoned mismatches corrupt amounts silently. Literals pass fixed tokens such as file name strings. After RETURN, caller fields callee modified by reference still hold updated values if linkage was BY REFERENCE.
Shops compile subprograms as separate load modules. Callee ends with RETURN; main driver CALLs them for reusable report slices or validation. Environment PARM CALL sets dynamic versus static binding default. STEPLIB must resolve callee module at runtime for dynamic CALL. Test promote path: fix callee, rerun caller without relink when dynamic.
Broadcom documents that programs called under CICS must execute conversational—the called program must not terminate the CICS task in ways that break pseudo-conversational design. RETURN to caller preserves transaction context; STOP in callee may end task unexpectedly. Coordinate with CICS systems programming on EXEC CICS RETURN equivalents in COBOL subprograms called from Easytrieve online.
Static binding resolves callee at link-edit; dynamic at runtime from STEPLIB. Wrong binding choice causes old callee level or module not found. RETURN does not fix linkage errors—verify binder deck includes callee when static. Returns field must be numeric working storage wide enough for return codes your callee sets.
CALL is asking a friend to solve one math problem for you. RETURN is the friend handing back the answer and saying done—you continue your homework. END-PROC is finishing one worksheet section inside your own notebook, not visiting a friend. STOP is closing the whole notebook and going home.
1. RETURN typically ends:
2. CALL pairs with RETURN in:
3. RETURNS on CALL clause:
4. RETURN differs from END-PROC because:
5. CICS called programs must: