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: COBDYNCO 000007* LANGUAGE: COBOL 000008* PURPOSE: THIS EXAMPLE DEMONSTRATES CALLING A C FUNCTION 000009* FROM COBOL, WHICH DYNAMICALLY LOADS ANOTHER LOAD 000010* MODULE. IT CONSISTS OF SAMPLE LIBRARY MEMBERS 000011* COBDYNC1, COBDYNC2, COBDYNCO, AND COBOLDYN. 000012* MVS - 000013* COMPILE: USE JCL PROVIDED IN SAMPLE.AUX(COBOLDYN). 000014* LINK: USE JCL PROVIDED IN SAMPLE.AUX(COBOLDYN). 000015* EXECUTE: USE JCL PROVIDED IN SAMPLE.AUX(COBOLDYN). 000016* TSO - 000017* COMPILE: COBOL - USE COBOL COMPILER. 000018* C - LC370C COBDYNC1 W/ INDEP,SN(CSTUB) OPTIONS. 000019* C - LC370CL COBDYNC2 SNAME(CPROG),ENTRY=DYNNR 000020* LINK: ILCLINK W/ CONTROL CARDS IN SAMPLE.AUX(COBOLDYN). 000021* EXECUTE: CALL.LOAD(COBOLDYN) 000022* CMS - 000023* COMPILE: COBOL - USE COBOL COMPILER. 000024* C - LC370 COBDYNC1 W/ INDEP,SN(CSTUB) OPTIONS. 000025* C - LC370 COBDYNC2 SNAME(CPROG),ENTRY=DYNNR 000026* LINK: ILCLINK W/ CONTROL CARDS IN SAMPLE.AUX(COBOLDYN). 000027* EXECUTE: CALL COBOLDYN 000028* MISC NOTES: THE FOLLOWING LSCL102 MESSAGE CAN BE IGNORED: 000029* CAN'T OPEN FILE DURING AUTOCALL: DDN:SYSLIB(IGZEBST) 000030*----------------------------------------------------------------- 000100 IDENTIFICATION DIVISION. 000200 PROGRAM-ID. COBMAIN. 000300 AUTHOR. XXX 000400 DATE-WRITTEN. 18 06 93. 000500 ENVIRONMENT DIVISION. 000600 CONFIGURATION SECTION. 000700 SOURCE-COMPUTER. IBM-370. 000800 OBJECT-COMPUTER. IBM-370. 001200 DATA DIVISION. 001300 WORKING-STORAGE SECTION. 001400 01 WS-C-PARAM. 001500 03 C-TOKEN PIC 9(09) COMP. 001600 03 C-OPTIONS PIC X(07) VALUE SPACES. 001700 03 ILC-OPTIONS PIC 9(09) COMP VALUE 0. 001800 03 COBOL-NAME PIC X(06) VALUE 'COBOL'. 001900 03 DCFMWK-ERR-FLAG PIC 9(09) COMP. 002000 PROCEDURE DIVISION. 002100 CALL 'CFMWK' USING 002200 COBOL-NAME 002300 C-OPTIONS 002400 ILC-OPTIONS 002500 C-TOKEN. 002800 CALL 'CSTUB'. 002900 CALL 'DCFMWK' USING 003000 C-TOKEN 003100 DCFMWK-ERR-FLAG. 003500 STOP RUN.