Thursday, December 22, 2011

COBOL : Explanation for AMODE and RMODE

Addressing Mode/Access Mode 
AMODE(24) indicates 24-bit (three-byte) addressing - memory below the line.
AMODE(31) indicates 31-bit addressing - memory above and below the line.
AMODE=ANY indicates the program may use either of the addressing technique.

Run Mode/Residency Mode 
RMODE(24) indicates that the program must be loaded into memory below the line
RMODE(31) indicates that the program can be loaded either below or above the line.
RMODE=ANY indicates that the program can be run in either 24 bit (below)or 31 bit memory(above).

AMODE establishes the address-mode your program is using.
RMODE is the option which establishes where your program is loaded.

It is legitimate (although, not, perhaps, a good idea) to have AMODE(24),RMODE(ANY) in your binder options. DATA(31) is a compile option, which specifies that working-storage will be acquired above the line (even if you have AMODE(24)). You need to check all three options and ensure that all of them are set to 24 if you want to avoid all 31-bit addresses. RMode 31 programs, batch or CICS, will be loaded above the 16M line until there is no room above the line. This is done to conserve space below the line for those who need it. Storage that is elgible to be allocated above the line is handled in the same manner. I said the COBOL ignores Data(31) for AMode(24) programs but I can only vouch for this under CICS. If your programs operate properly in Amode(31) with Data(31) and you are satisfied that all paths through each program have been executed then you are probably home free. By the way, for EXEC CICS LINK, a Data(31) Commarea passed to an AMode(24) program is copied, using the LENGTH on the LINK, to an area below the line and the new area is passed to the other program. If the AModes are the same then the LENGTH on the LINK is of no consequence. A few programs have been "bushwacked" by an incorrect LENGTH on a LINK with programs of different AModes.

COBOL ignores Data(31) when Amode is 24.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.