C ------------------------------------------------------------------
C                Copyright (c) 1995, SAS Institute Inc.
C                  Unpublished - All Rights Reserved
C                    S A S / C   S A M P L E
C
C       NAME: FORTCXPF
C   LANGUAGE: FORTRAN
C    PURPOSE: THIS EXAMPLE DEMONSTRATES A FORTRAN PROGRAM CALLING
C             A C++ FUNCTION.
C             IT CONSISTS OF SAMPLE LIBRARY MEMBERS
C             FORTCXPC, FORTCXPF, AND FORTCXPM.
C MVS -
C    COMPILE: USE JCL PROVIDED IN SAMPLE.AUX(FORTCXPM).
C       LINK: USE JCL PROVIDED IN SAMPLE.AUX(FORTCXPM).
C    EXECUTE: USE JCL PROVIDED IN SAMPLE.AUX(FORTCXPM).
C TSO -
C    COMPILE: FORTRAN - USE FORTRAN COMPILER.
C             C++ - LCXX  FORTCXPC USING INDEP OPTION.
C       LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(FORTCXPM).
C    EXECUTE: CALL .LOAD(FORTCXPM)
C CMS -
C    COMPILE: FORTRAN - USE FORTRAN COMPILER.
C             C++ - LCXX FORTCXPC USING INDEP OPTION.
C        LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(FORTCXPM).
C     EXECUTE: CALL FORTCXPM
C MISC NOTES: THE FOLLOWING LSCL102 MESSAGES CAN BE IGNORED:
C   WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(IFYVINTE)
C   WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(VFEE#)
C   WARNING: CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(VFES#)
C -------------------------------------------------------------------
C
C      FORTRAN MAIN routine
C
       PROGRAM FORPRG
       INTEGER*4 TOKEN, ERR
       CALL CFMWK('FORTRAN.', '.', 0, TOKEN)
       IF (TOKEN.EQ.0) STOP 16
       CALL CPROG('HELLO, FORTRAN/C++ WORLD!')
       CALL DCFMWK(TOKEN, ERR)
       IF (ERR.NE.0) STOP 8
       STOP
       END