[Migrated content. Thread originally posted on 16 August 2003]
Hi,I've got all sorts of problems related to this.
It's to do with emulating HP MPE stuff so the syntax of some of this code is HP specific so you have to use the "-Cp" option with ACU 6.
The problem is with code like this -
WORKING-STORAGE SECTION.
01 pvalue PIC S9(4) COMP VALUE 40.
PROCEDURE DIVISION.
LEVEL-1 SECTION.
blah
CALL "hp3_cobol.dll"
* this passes pvalue by reference
CALL "PARMTEST" USING pvalue pvalue.
* this passes 40 by value
CALL "PARMTEST" USING \\5\\ \\40\\.
* this passes pvalue by value but gives 10240 (wrong byte order)
CALL "PARMTEST" USING \\5\\ pvalue
In the DLL I have a bit of C code which get's 3 different values for the 2nd parameter as described in the COBOL comments above. I can cope with getting a by value or a by reference due to a dirty hack. If the value is >= 0xffff then I assume it's by reference and convert.
But in this example, if you pass a constant first, it then decides to pass the 2nd one by value but gets the byte ordering wrong.
What can I do?
I can't change the COBOL code really as the whole point of the -Cp flag is that you can compile your COBOL code as is (we're doing a migration - not a re-write). Although, as a last resort, I could probably change the working storage if that helped but I wouldn't know what to change it to.
Cheers
Peter



