M$PUT (Dynamic Memory Routine)

Stores data in an allocated memory block.
Note: This ACUCOBOL-GT library routine is available in this COBOL version. Any compatibility issues in this COBOL system are in the Compatibility Issues section at the end of the topic.

Usage

CALL "M$PUT" 
    USING MEM-ADDRESS, DATA-ITEM, DATA-SIZE, DATA-OFFSET

Parameters

MEM-ADDRESS USAGE POINTER Must point to a memory area previously allocated by M$ALLOC.
DATA-ITEM Any data item This is the data that will be stored in the memory block.
DATA-SIZE Numeric parameter (optional) The number of bytes to move to the memory block. If omitted, then the number of bytes is set to the size of the memory block (excluding overhead bytes).
DATA-OFFSET PIC 9(n), USAGE DISPLAY or COMP-4 (optional) The location within the memory block from which to start the move. The first location is position 1. If omitted, this value defaults to 1.

Description

This routine copies DATA-ITEM into the memory pointed to by MEM-ADDRESS for DATA-SIZE bytes. Regardless of the value of DATA-SIZE, no bytes are copied that exceed the size of the memory block at MEM-ADDRESS.

Compatibility Issues

None.