Hello world.
I need to call a c program from cobol, and I need to change the value of WKDATA.
wkdata is :
01 wk-data.
05 wk-ll pic xx.
05 wk-myparam pic x(10).
01 WKRETCODE pis s9(4) comp.
PROCEDURE DIVISION.
move 'aabbccddee' to wk-myparam.
display wk-myparam.
CALL "Cprogram" USING BY REFERENCE WKDATA RETURNING WKRETCODE.
display wk-myparam.
goback.
Cprogram
#incude...
#include..
int main(int argc, char *argv[])
{
cout << "\n Num. Param " << argc;
cout << "\n ..... Param " << argv[1]; //it shows aabbccddee and it's OK
//now i want to change this value argv[1]
strcpy(argv[1],"ffgghhiijj");
cout << "\n new value param " << argv[1] // it shows the new value ffgghhiijj and it's OK
return(strlen(argv[1])); //it returns the length of the first parameter in this case 10 and it's OK
}
Now the question.....when the Cprogram comes back in cobol program the value of wk-myparam doesn't change...
if i write the subprogram in cobol it works fine but i need the subprogram in C.
I need to change it wk-myparam.
How can i solve this problem? can u help me??
Thank's a lot.
R.