z/OS Language Environment Writing Interlanguage Communication Applications
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


16-bit signed binary integer with #pragma

z/OS Language Environment Writing Interlanguage Communication Applications
SA38-0684-00

Sample C usage COBOL subroutine
#pragma linkage(cobrtn,COBOL)
#include <stdio.h>
void cobrtn (short int*);

int main()
{
  short int x;
  x=5;
  cobrtn(&x);  /* x by reference */
}
IDENTIFICATION DIVISION.
PROGRAM-ID. COBRTN.
ENVIRONMENT DIVISION.
DATA DIVISION.
LINKAGE SECTION.
01 X PIC S9(4) BINARY.
PROCEDURE DIVISON USING X.
      DISPLAY X
      GOBACK.
END PROGRAM COBRTN.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014