Good point, but that compiled C module is in that library but i Sam: Good point, but that compiled C module is in that library but it brings a good point. According the the LE/C manuals the binder should look like this:
INCLUDE SYSLIB(EDCSTART) INCLUDE SYSLIB(CEEROOTB) INCLUDE SYSLIB(IGZEBST) INCLUDE SYSLIB(@@CBL2C) INCLUDE SYSMOD(xxx) <- I think this should be the C module ENTRY CBLRTN <- cobol routine NAME XXXX(R) <- name for the cobol routine The CSECT for C was wrong in the linkage output , here is the line from the Binder... z/OS V1 R10 BINDER 12:52:13 THURSDAY SEPTEMBER 16, 2010 BATCH EMULATOR JOB(ADCDMETA) STEP(LKED ) PGM= HEWL IEW2278I B352 INVOCATION PARAMETERS - AMODE=31,MAP IEW2650I 5102 MODULE ENTRY NOT PROVIDED. ENTRY DEFAULTS TO SECTION $PRIV000010. Maybe its me, but this looks wrong Scott J Ford ________________________________ From: Sam Siegel <[email protected]> To: [email protected] Sent: Thu, September 16, 2010 2:38:31 PM Subject: Re: Cobol calling C function On Thu, Sep 16, 2010 at 11:27 AM, Scott Ford <[email protected]> wrote: > START OF TS04A > CEE3207S The system detected a data exception ( > zMan: > > START OF TS04A > CEE3207S The system detected a data exception (System Completion Code=0C7). > From compile unit THRALLC at entry point THRALLC at compile unit > offset > at address 11A00E4E. > > Looks like I have something wrong in C. I am not a C heavy...So any help is > super great ! > Thanks > > I'm not sure if this is related but you appear to be dynamically calling a > function that you have statically linked. Are you sure that you are picking > up the correct version of TSO4B? > Sam > > Scott J Ford > > > > > > ________________________________ > From: zMan <[email protected]> > To: [email protected] > Sent: Thu, September 16, 2010 1:58:43 PM > Subject: Re: Cobol calling C function > > What is the failure you're seeing? > > On Thu, Sep 16, 2010 at 1:38 PM, Scott Ford <[email protected]> > wrote: > > I have seen several 'bit and piece' posts on LE Cobol calling C > > All: > > > > I have seen several 'bit and piece' posts on LE Cobol calling C. I have > written > > a sample C call and here is the source and have included the C source and > JCL > , > > Cobol source and JCL, I dont understand what I have missed, I have been > through > > the LE Books and C-C++ books and I am confused and the execution is > receiving > a > > S0C7 : > > > > JCL for 'C' compile: > > ---------------------- > > > > //ADCDMETA JOB SYSTEMS,MSGLEVEL=(1,1),MSGCLASS=X,CLASS=A,PRTY=8, > > // NOTIFY=&SYSUID,REGION=0M > > // EXEC EDCCL, > > // INFILE=SFORD.JCLLIB.CNTL(TESTC)', > > // OUTFILE='SFORD.CLINKLIB(TS04B),DISP=SHR' > > > > 'C' Source: > > ------------------- > > > > #include <stdio.h> > > #include <string.h> > > #pragma linkage(TS04B,COBOL) > > void TS04B( char *pBuffer ) > > { > > strcpy( pBuffer, "OK "); > > fprintf(stderr,"ok trans\n"); > > } > > > > LE Cobol V4r1 JCL: > > -------------------------- > > > > //ADCDTHRA JOB SYSTEMS,MSGLEVEL=(1,1),MSGCLASS=X,CLASS=A,PRTY=8, > > // NOTIFY=&SYSUID,REGION=4096K > > //*---------------------------------------------------------------- > > //COB EXEC PGM=IGYCRCTL, > > // PARM=('NOC(E)','FLAG(W)','DATA(31)',NODYN,RES,RENT,OPT, > > // MAP,NOSSR,NOZWB,NUM,NOTERM,NOVBREF,X,APOST,LIB,LIST), > > // REGION=1024K > > //STEPLIB DD DISP=SHR,DSN=IGY410.SIGYCOMP > > //SYSLIB DD DISP=SHR,DSN=CEE.ACEESRC1 > > // DD DISP=SHR,DSN=SFORD.CLINKLIB > > //SYSPRINT DD SYSOUT=X > > //SYSUT1 DD UNIT=VIO > > //SYSUT2 DD UNIT=VIO > > //SYSUT3 DD UNIT=VIO > > //SYSUT4 DD UNIT=VIO > > //SYSUT5 DD UNIT=VIO > > //SYSUT6 DD UNIT=VIO > > //SYSUT7 DD UNIT=VIO > > //SYSLIN DD DISP=(,PASS),DSN=&&LOADSET, > > // UNIT=VIO, > > // DCB=BLKSIZE=3200 > > //SYSIN DD DISP=SHR,DSN=SFORD.COBOL.SOURCE(THRALLC) > > //* > > //LNK EXEC PGM=IEWL, > > // COND=(4,LT,COB), > > // PARM='LIST,XREF', > > // REGION=4096K > > //SYSLIB DD DISP=SHR,DSN=SFORD.CLINKLIB > > // DD DISP=SHR,DSN=CEE.SCEELKED > > // DD DISP=SHR,DSN=SYS1.CSSLIB > > // DD DISP=SHR,DSN=TCPIP.SEZATCP > > //SYSLMOD DD DISP=SHR,DSN=SFORD.CLINKLIB > > //SYSUT1 DD UNIT=SYSDA, > > // DCB=BLKSIZE=1024, > > // SPACE=(1024,(200,20)) > > //SYSPRINT DD SYSOUT=X > > //SYSLOUT DD SYSOUT=X > > //SYSLIN DD DISP=(OLD,DELETE),DSN=&&LOADSET > > // DD DDNAME=SYSIN > > //SYSIN DD * > > MODE AMODE(31),RMODE(ANY) > > INCLUDE SYSLIB(EDCSTART) > > INCLUDE SYSLIB(CEEROOTB) > > INCLUDE SYSLIB(@@CBL2C) > > INCLUDE SYSLMOD(TS04B) > > ENTRY THRALLC > > NAME THRALLC(R) > > /* > > // > > > > LE Cobol Source: > > --------------------- > > > > IDENTIFICATION DIVISION. > > PROGRAM-ID. THRALLC. > > ENVIRONMENT DIVISION. > > INPUT-OUTPUT SECTION. > > FILE-CONTROL. > > DATA DIVISION. > > FILE SECTION. > > WORKING-STORAGE SECTION. > > 01 TS04B PIC X(8) VALUE 'TS04B'. > > 01 TESTIT PIC X(10) VALUE 'SCOTT'. > > PROCEDURE DIVISION. > > DISPLAY 'START OF TS04A'. > > CALL TS04B USING TESTIT. > > DISPLAY TESTIT. > > GOBACK. > > > > Sorry for the long post, but I think one has to see all the pieces. > > Please tell me am I blind in my old age or what... > > Thanks in advance. > > > > > > Scott J Ford > > > > > > > > > > ---------------------------------------------------------------------- > > 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 > > > > > > -- > zMan -- "I've got a mainframe and I'm not afraid to use it" > > ---------------------------------------------------------------------- > 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 > > > > > > ---------------------------------------------------------------------- > 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 > ---------------------------------------------------------------------- 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 ---------------------------------------------------------------------- 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

