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


Fixed-length decimal data without #pragma

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

Sample COBOL usage C function
IDENTIFICATION DIVISION.
PROGRAM-ID.  COBRTN.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 X PIC 999V99 COMP-3.
PROCEDURE DIVISION.
    CALL "CENTRY" RETURNING X.
    GOBACK.
END PROGRAM COBRTN.
#include <stdio.h>
#include <decimal.h>

decimal(5,2) centry()
{
  decimal(5,2) x=123.45;
  printf("%D(5,2)\n",x);
  return x;
}

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014