All OS/VS COBOL programs are AMODE 24 and RMODE 24. Enterprise COBOL programs are always AMODE ANY and can be either RMODE 24 or RMODE ANY. The WORKING-STORAGE data items can be either above or below the 16-MB line, based on the DATA, RENT and RMODE compiler options.
OS/VS COBOL programs can use CALL statements to call Enterprise COBOL programs without AMODE problems, because both programs can access below the 16-MB line data. When an Enterprise COBOL program uses a CALL statement to call an OS/VS COBOL program, you can get addressing exceptions if your data or parameter list is above the 16-MB line.
Figure 1 shows the results of different combinations of compiler options and compilers. All CALL statements are dynamic and represented by arrows. The solid lines represent valid CALL statements; the dotted line represents a call that is not valid.
P1 and P5 are OS/VS COBOL programs, so the WORKING-STORAGE data items are included in the object module, and must be below the 16-MB line. For Enterprise COBOL programs that were compiled with the RENT option, WORKING-STORAGE data items are separate from the object module, and their location is controlled by the DATA compiler option (as with programs P2 and P3). For programs compiled with NORENT, the WORKING-STORAGE data items are included in the object module, so their location depends on the RMODE option (as with program P4).
All of these calls will work successfully, except for P3 calling P5. Because P3 was compiled with RENT and DATA(31), its WORKING-STORAGE and any parameter lists are located above the 16-MB line. This means that even if P3 is passing parameters that it received from P2, the parameter list cannot be addressed by P5, so the CALL will fail. The CALL will also fail if the parameters themselves are above the 16-MB line, such as data items in the WORKING-STORAGE SECTION of P1 and P3.