[Info-vax] COBOL PIC format for a 64 bit unsigned int ("long long") ?

glen herrmannsfeldt gah at ugcs.caltech.edu
Mon Oct 12 18:24:03 EDT 2009


Jan-Erik S?derholm <jan-erik.soderholm at telia.com> wrote:
< I am trying to call some COBOL code from a piece of C...
 
< The call from C looks like this :
 
<  char cob_inart[16];
<  unsigned long long cob_insernr;
<  char cob_utben[16];
<  char cob_utordnr[16];
<  int rc;
 
<  rc = MES101(cob_inart, cob_insernr, cob_utben, cob_utordnr);
 
< I get a ACCVIO when trying to use the "unsigned long long"
< paramater on the COBOL side. I have probably not got the
< right PIC clause to match the "unsigned long long", I guess.

I don't know specifically about COBOL, but calls from C to
many other languages expect the address of, not the value of,
the arguments.  For arrays that happens sort of automatically
(an array name is a constant pointer to the first element),
but not for scalars.  Try an & in front of the non-array.

(Maybe %ref would also work.)

-- glen



More information about the Info-vax mailing list