![Start of change](../delta.gif)
Dynamic call between AMODE 31 and AMODE 64 programs
Calls between AMODE 64 programs and AMODE 31 programs (when a subprogram has a different AMODE from the caller) can only be done via dynamic CALL. The caller can be AMODE 31 or 64. No indication in the CALL statement is needed. The dynamic call handler in the COBOL runtime determines the AMODE of the subprogram and processes accordingly.
The programs must be compiled by COBOL 6.3 or above. If the RETURNING phrase in the CALL
statement is not used, the AMODE 31 program can be compiled with COBOL 5.1 and later releases. Non-COBOL programs are not supported by mixed AMODE 31/64 COBOL dynamic call.
The user program needs to make sure data items passed in parameters, directly or indirectly, are accessible by the subprogram. The DATA directive can be used to specify the storage location as required.
Parameter Passing
Both CALL ... USING BY REFERENCE and CALL ... USING BY CONTENT are supported.
CALL ... USING BY VALUE parameter is not supported.
If the CALL ... RETURNING phrase is used, the returning data item must not be larger then 24 bytes.
- alphanumeric
- zoned decimal
- COMP-3 (packed-decimal)
- COMP-4
- COMP-5
- COMP (BINARY)
Subprogram in dynamic call
When compiling the caller program, the DLL option is not needed. This is to facilitate mixed AMODE usage when the subprogram of an existing pure AMODE 31 application is recompiled with LP(64) while the caller program can remain in AMODE 31. The subprogram can be called by the caller program without recompiling the caller program with the DLL compiler option.
![Start of change](../delta.gif)
![End of change](../deltaend.gif)
- When building a DLL, specify the compiler options EXPORTALL and DLL, and the binder options RENT and DYNAM=DLL.
- The program-id in the DLL program must be the same as the DLL module name. Otherwise the DLL cannot be called using dynamic call.
External file
The same external file can not be accessed by programs with different AMODE settings.
DATA (Enterprise COBOL for z/OS® Language Reference)
CALL statement (Enterprise COBOL for z/OS Language Reference)
![End of change](../deltaend.gif)