000001**--------------------------------------------------------------- 000002* COPYRIGHT (C) 1995, SAS INSTITUTE INC. 000003* UNPUBLISHED - ALL RIGHTS RESERVED 000004* S A S / C S A M P L E 000005* 000006* NAME: COB2CPCO 000007* LANGUAGE: COBOL 000008* PURPOSE: THIS EXAMPLE DEMONSTRATES CALLING C FUNCTIONS 000009* FROM COBOL, WHICH THEN CALL OTHER C FUNCTIONS. 000010* IT CONSISTS OF SAMPLE LIBRARY MEMBERS 000011* COB2CPC, COB2CPCO, AND COB2CPRM. 000012* MVS - 000013* COMPILE: USE JCL PROVIDED IN SAMPLE.AUX(COB2CPRM). 000014* LINK: USE JCL PROVIDED IN SAMPLE.AUX(COB2CPRM). 000015* EXECUTE: USE JCL PROVIDED IN SAMPLE.AUX(COB2CPRM). 000016* TSO - 000017* COMPILE: COBOL - USE COBOL COMPILER. 000018* C - LC370C COB2CPC, W/ INDEP,SN(CPROG) OPTIONS. 000019* LINK: ILCLINK W/ CONTROL CARDS IN SAMPLE.AUX(COB2CPRM). 000020* EXECUTE: CALL.LOAD(COB2CPRM) 000021* CMS - 000022* COMPILE: COBOL - USE COBOL COMPILER. 000023* C - LC370 COB2CPC, W/ INDEP,SN(CPROG) OPTIONS. 000024* LINK: ILCLINK W/ CONTROL CARDS IN SAMPLE.AUX(COB2CPRM). 000025* EXECUTE: CALL COB2CPRM 000028* MISC NOTES: THE FOLLOWING LSCL102 MESSAGE CAN BE IGNORED: 000029* CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(IGZEBST) 000030*----------------------------------------------------------------- 000100 IDENTIFICATION DIVISION. 00010000 000200 PROGRAM-ID. COBMAIN. 00020000 000300 AUTHOR. XXX 00030001 000400 DATE-WRITTEN. 18 06 93. 00040001 000500 ENVIRONMENT DIVISION. 00050000 000600 CONFIGURATION SECTION. 00060000 000700 SOURCE-COMPUTER. IBM-370. 00070000 000800 OBJECT-COMPUTER. IBM-370. 00080000 001200 DATA DIVISION. 00120000 001300 WORKING-STORAGE SECTION. 00130000 001350 77 COMMENT PIC X(20) VALUE 'HELLO, FROM COBOL'. 001400 01 WS-C-PARAM. 00140000 001500 03 C-TOKEN PIC 9(09) COMP. 00150000 001600 03 C-OPTIONS PIC X(07) VALUE SPACES. 00160000 001700 03 ILC-OPTIONS PIC 9(09) COMP VALUE 0. 00170000 001800 03 COBOL-NAME PIC X(06) VALUE 'COBOL'. 00180000 001900 03 DCFMWK-ERR-FLAG PIC 9(09) COMP. 00190000 002000 PROCEDURE DIVISION. 00200000 002050 DISPLAY COMMENT. 002100 CALL 'CFMWK' USING 00210004 002200 COBOL-NAME 00220004 002300 C-OPTIONS 00230004 002400 ILC-OPTIONS 00240004 002500 C-TOKEN. 00260004 002800 CALL 'CPROG' USING COMMENT. 00280001 002900 CALL 'DCFMWK' USING 00290004 003000 C-TOKEN 00300004 003100 DCFMWK-ERR-FLAG. 00310004 003200 DISPLAY COMMENT. 003500 STOP RUN. 00350001