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: FORT2CPF
C   LANGUAGE: FORTRAN
C    PURPOSE: THIS EXAMPLE DEMONSTRATES A FORTRAN PROGRAM CALLING
C             A C FUNCTION.
C             IT CONSISTS OF SAMPLE LIBRARY MEMBERS
C             FORT2CPC, FORT2CPF, AND FORT2CPM.
C MVS -
C    COMPILE: USE JCL PROVIDED IN SAMPLE.AUX(FORT2CPM).
C       LINK: USE JCL PROVIDED IN SAMPLE.AUX(FORT2CPM).
C    EXECUTE: USE JCL PROVIDED IN SAMPLE.AUX(FORT2CPM).
C TSO -
C    COMPILE: FORTRAN - USE FORTRAN COMPILER.
C             C - LC370C FORT2CPC USING INDEP OPTION.
C       LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(FORT2CPM).
C    EXECUTE: CALL .LOAD(FORT2CPM)
C CMS -
C    COMPILE: FORTRAN - USE FORTRAN COMPILER.
C             C - LC370 FORT2CPC USING INDEP OPTION.
C        LINK: ILCLINK, USING CONTROL CARDS IN SAMPLE.AUX(FORT2CPM).
C     EXECUTE: CALL FORT2CPM
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