The fixed-format REALLOC opcode resizes previously allocated heap storage while preserving existing data:
D pBuf S *
D wBuf S 20A BASED(pBuf)
C ALLOC 20 pBuf
C EVAL wBuf = 'Hello'
C REALLOC 40 pBuf
Factor 2 is the new byte length. The result field is the basing pointer variable (must already point to allocated storage). Existing data is preserved up to min(old length, new length). If the new length is larger, additional storage is uninitialized. The (E) operation extender and ER resulting indicator (columns 73 - 74) work identically to ALLOC (status 00425 for length out of range, 00426 for storage error).