/*-------------------------------------------------------------------+ | Copyright (c) 1995, SAS Institute Inc. | | Unpublished - All Rights Reserved | | S A S / C S A M P L E | | | | | | NAME: COB1A | | LANGUAGE: C | | PURPOSE: Show a call to a COBOL function | | MVS - | | COMPILE: See JCL in SAMPLE.AUX(COBOLJCL). | | LINK: See JCL in SAMPLE.AUX(COBOLJCL). | | EXECUTE: See JCL in SAMPLE.AUX(COBOLJCL). | | TSO - | | COMPILE: LC370C with INDEP option. | | LINK: LKED, using link cards in COBOLJCL. | | EXECUTE: Call CCOBOL. | | CMS - | | COMPILE: LC370C with INDEP option. | | LINK: CLINK, using link cards in COBOLJCL. | | EXECUTE: Call CCOBOL. | | | | INPUT: none | | OUTPUT: Printed string before and after call to COBOL | | | | SYSTEM NOTES: The COBOL routine ILBOSTP0 initializes the COBOL | | environment. It should be the first routine called | | in the C main. | | MISC NOTES: The routines COB1B and COB1C are also required. | | THIS IS A NON-ILC EXAMPLE. | | | +-------------------------------------------------------------------*/ #eject #includechar str(||)="AbCdEfGhIjKlMnOpQrStUvWxYz"; main() { /* Start the COBOL environment */ /* This should always be the first function when calling COBOL */ ILBOSTP0(); /* Print string before and after conversion. */ printf("Alphabet with alternating case: %s\n", str); /* call COBOL routine */ cob1b(str); /* print resulting string */ printf("Alphabet with all-upper case: %s\n", str); return(0); }