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

Jan-Erik Söderholm jan-erik.soderholm at telia.com
Mon Oct 12 17:33:36 EDT 2009


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.

Currently it looks like this (in MES101.COB) :

  WORKING-STORAGE SECTION.
  01 Answer             PIC S9(9) COMP.

  LINKAGE SECTION.
  01 c_inart            PIC X(16).
  01 c_insernr          pic 9(16) comp.
  01 c_ben              PIC X(16).
  01 c_ordnr            PIC X(16).

  PROCEDURE DIVISION USING c_inart c_insernr c_ben c_ordnr
                           giving Answer.

As soon as I try to do anything  with the "c_insernr"
paramater (such as DISPLAY or MOVE) the COBOL code ACCVIO's.

Does anyone have a clue what the PIC clause should look
like to match a "unsigned long long" ?

And yes, I have scanned the COBOL and C User Guides and
Ref Manuals, but didn't find anything clear on this point.






More information about the Info-vax mailing list