Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Compiler and Runtime Migration Guide


AMODE and RMODE considerations

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.

To avoid addressing exceptions, ensure that all of your data and parameter lists are below the 16-MB line by compiling with DATA(24) for RENT programs, or RMODE(24) or RMODE(AUTO) for NORENT programs.
Note: For Language Environment releases prior to Version 2 Release 9, a request for DATA(31) might have resulted in Language Environment acquiring the storage below the 16-MB line, so that incorrectly compiled programs could pass parameters to OS/VS COBOL programs without addressing exceptions. After moving to Language Environment ,Version 2 Release 9 or later, this incorrect use of DATA(31) would result in the expected addressing exception.

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.

Note: Static CALL statements from AMODE 31 programs to OS/VS COBOL programs will always fail.
Figure 1. Valid and not valid calls between OS/VS COBOL and Enterprise COBOL programs
igym1018 Begin figure description. This figure is described in surrounding text. End figure description.

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)