[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[open-cobol-list] static cobol 2 c : passing numeric data by reference ?
From: |
Xavier COUDIN |
Subject: |
[open-cobol-list] static cobol 2 c : passing numeric data by reference ? |
Date: |
Thu Oct 20 09:57:50 2005 |
hi,
I am making some test (self-learning).
I make 1 small program in cobol, and 1 small program in C.
I call the C-written subrouting from cobol.
I want transmit some numeric data BY REFERENCE, because I want the C
function to modify the value of the numeric data and get back this
data in the Cobol main program.
The compilation works very well, but when executing I can not receive
the numeric data, I just receive wrong-end-strange value.
Is there a way to get it working ?
What is the type of data transmitted from COBOL to C concerning BINARY
numerical values : int ? long ? float ? double ?
example :
on the COBOL side, I write :
01 capsule.
02 phrase pic X(10).
02 c pic 9999 VALUE 3 BINARY.
and create the same structure in the C module
typedef struct abcd {
char phrase[10];
int compteur ;
} efgh;
I can get the string without any problem.
But the numerical value I get is completely wrong, nom atter of
numerical type I declare on the C side (int / long / float / double).
Any solution ?
- [open-cobol-list] static cobol 2 c : passing numeric data by reference ?,
Xavier COUDIN <=