For Systems/C; you can use our Direct CALL runtime support (DCALL) to accomplish this.
See the Dignus C library reference manual, at http://www.dignus.com/dcc/clib.pdf for more information on our Direct CALL support. - Dave Rivers - cnps wrote:
Hi, I am trying to call a C routine from COBOL pgm. I have few questions. Is it possible to statically call a C routine from a COBOL pgm? If yes can we also return the result of the C routine(statically called) to the COBOL pgm. Do i need to use #pragma for this? Can i return a string from the C routine to my COBOl pgm? Copied below is my COBOL pgm and C routine.Can anyone please help me with this? PROCESS NODYNAM MAP LIST IDENTIFICATION DIVISION. PROGRAM-ID. CALLRT1. AUTHOR. CNPS. DATA DIVISION. WORKING-STORAGE SECTION. 01 ONEARG PIC X(10) VALUE "ABCDEFG123". 01 B1 PIC X(30). PROCEDURE DIVISION. MAIN. DISPLAY "ONEARG IS " ONEARG. CALL "PADWPD" USING BY REFERENCE ONEARG RETURNING B1. DISPLAY "PADDED STRING " B1. DISPLAY "PADWPD'S RC IS " RETURN-CODE. MOVE 0 TO RETURN-CODE. STOP RUN. #include<stdio.h> #include<ctype.h> #include<string.h> #include<stdlib.h> int PADWPD(char *onearg) { char b??(30??); printf("onearg%s",onearg); strcpy(b,","); strcat(b, "###"); strcat(b, onearg); strcat(b, "###"); printf("Bvalue%s",b);return b; }
-- [EMAIL PROTECTED] Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

