I have a COBOL program that call a Assembly module. This module returns a Pointer to some data (I'll call it 'buffer') obtained inside this module. How can I address a variable in my working storage to this pointer and use the data?
In my COBOL caller I have something like:
Working Storage:
01 WK-MOD-AREA.
03 WK-MOD-PTR PIC 9(09) COMP VALUE 0.
01 WK-BUFFER-PTR USAGE POINTER.
01 FILLER REDEFINES WK-BUFFER-PTR.
03 WK-BUFFER-PTR-COMP PIC 9(09) COMP.
01 WK-BUFFER-DATA PIC X(5656) VALUE SPACES.
Procedure Division:
CALL 'MYMOD' USING WK-MOD-AREA.
MYMOD returns an address in WK-MOD-PTR.
I just tryed address the data using:
MOVE WK-MOD-PTR TO WK-BUFFER-PTR-COMP.
SET ADDRESS OF WK-BUFFER-PTR TO WK-BUFFER.
But it gives me the compiller error:
==000657==> IGYPS2161-S "ADDRESS OF" operand "WRK-BUFFER"
was found as the receiving operand of a "SET" statement,
but was not a level-01 or level-77 "LINKAGE SECTION" item.
The statement was discarded.
Thanks in advance.