CALL extends Easytrieve batch and online programs with subprograms your shop already maintains in COBOL, Assembler, or C. Tax calculation, credit scoring, date routines, or vendor packages invoked through CALL keep Easytrieve as orchestration layer while specialized logic stays in compiled modules. Syntax: CALL program-name optional USING parameter-list optional RETURNS return-code-field. Parameters are working storage fields, file fields, or quoted literals in parentheses. RETURNS names numeric field receiving return code—COBOL RETURN-CODE, Assembler register 15 on z/OS, C function return. Static versus dynamic binding follows Environment PARM CALL and platform defaults—dynamic on mainframe and Windows per Broadcom. CICS programs must call conversational subprograms that do not terminate the task. CALL differs from PERFORM which invokes Easytrieve PROC in same program. This page teaches syntax, parameter passing, return code handling, binding defaults, CICS rules, link-edit and STEPLIB considerations, and common integration mistakes beginners make reusing COBOL linkage without matching field layouts.
123CALL program-name CALL program-name USING (field-a, field-b) CALL program-name USING ('LITERAL', USERFLD) RETURNS RC-FIELD
Program-name identifies load module. USING lists one or more parameters in parentheses, comma-separated. Each entry is field-name or quoted literal. RETURNS names numeric receive field for return code.
Parameters must be system-defined fields, working storage, or fields on accessible files per Broadcom. Match called program linkage section—length, type, order. COBOL BY REFERENCE expects Easytrieve fields at correct offsets. Literals pass fixed values such as file name tokens. Document parameter contract in comment block both sides maintain during change control.
| Clause | Purpose | Required? |
|---|---|---|
| program-name | Target load module | Yes |
| USING (...) | Argument list | No |
| RETURNS field | Receive return code | No |
123456CALL ASMPGM CALL ASMPGM USING ('USERFIL', USERFLD) IF RC NE 0 DISPLAY 'CALL FAILED RC=' RC END-IF
PARM CALL on Environment statement sets default binding for all CALL statements in program. z/OS and Windows default dynamic if not overridden—runtime loads module from STEPLIB or PATH. Unix default static—subprogram bound at link. Wrong assumption causes module not found at runtime or stale level not picked up after subprogram fix. Operations documents which style production uses; developers test CALL after subprogram promote.
RETURNS field should be numeric W storage. After CALL, IF RETURNS GT 0 branch to error PROC. COBOL programs set RETURN-CODE in special register; Assembler uses R15; C returns integer. Align semantics with called language—some shops use zero success, others zero failure. Standardize per integration guide.
| Aspect | CALL | PERFORM |
|---|---|---|
| Target | External load module | Easytrieve PROC same program |
| Language | COBOL Asm C etc | Easytrieve only |
| Linkage | USING parameters | Shared fields in Library |
| Overhead | Higher—program switch | Lower—in-process |
Broadcom warns mainframe programs called in CICS must execute conversational—called program must not terminate the task. Easytrieve online transactions relying on CALL must coordinate with CICS program definition and EXEC CICS RETURN patterns in subprogram. Batch CALL has no this restriction.
Dynamic CALL resolves module at runtime from load libraries in STEPLIB or job LIBDEF. Static CALL requires subprogram in link step. Missing STEPLIB entry causes abend U1210-class module not found—operations add library to JCL. Version skew when Easytrieve passes new field layout but COBOL still expects old length causes storage overlay—regression test CALL after any linkage change.
CALL is asking another expert to do a specialized job. You hand them the papers they need USING your folder. They hand back a note saying done or oops RETURNS return code. PERFORM is asking your teammate in the same room—same language, same notebook. CALL walks to another office where they speak COBOL or Assembler instead of Easytrieve.
1. CALL ASMPGM USING passes:
2. RETURNS on CALL identifies:
3. Default CALL binding on z/OS is typically:
4. In CICS, called program must:
5. CALL without USING: