Hi Peter, can you please share the program name clause of the DLL and the compile + the link option? Does the DLL just contain one function/entry point or more?
I recall there were several cases where the load failed, but the reason was not, that the module was not there and it was not a DLL. But there were no separate reason codes for the different cases. Please also check the C code (which was created for the 7 (or 6?) byte module name), that the length calculation for the CEL4RO31 call parameters (module length, function name length) is correct. At one time I changed a name to be longer and then the load did not work, because there was a shift inside the byte blob that makes the CEL4RO31 parameters. I borrowed the C code but it can easily go wrong if something is changed. Hope that helps Denis. On Wednesday, July 10, 2024 at 06:15:36 PM GMT+2, Farley, Peter <0000031df298a9da-dmarc-requ...@listserv.ua.edu> wrote: Hi Denis, First, thank you for such an interesting blog. Answering your questions: Yes, I did export a STEPLIB with the hlq.PDSE that contains all three of the COBOL programs before running the python script (we are Ent. COBOL V6.2 here). All COBOL programs were compiled and bound/linked with JCL into that PDSE. I have saved copies of the compile and link listings for each one. Yes, the first COBOL is compiled as DLL. It may be that the C program is not compiled/linked correctly though. Peter From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of Denis Sent: Wednesday, July 10, 2024 1:05 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: python calling COBOL [was: RE: z/OS 3.1 Enhancements & Support News] Hi Peter, retcode 4 means failed to load target DLL (COBOL). Did you do an export STEPLIB=HLQ.DSN where the COBOL DLL resides? Is the first COBOL compiled as DLL? Did not had the time yet to upload the sources to the git repo. Denis. On Wednesday, July 10, 2024 at 01:07:52 AM GMT+2, Farley, Peter <0000031df298a9da-dmarc-requ...@listserv.ua.edu> wrote: Not in SYSLIB for the LINK step as far as I could see (“ax” and “bx” outputs from the “cc” link step are pasted below), but hlq.SCEERUN2 is in the LINKLIST here. I am using the “cc” module I could find on our system, so my actual compile and link of that program from the z/OS Unix shell may or may not be correct. I am a total newbie to compiling under the shell, so I may have not done everything needed to make this go right. Plus I am not certain at all that the Unix version of “cc” that I found on the system is current or even configured correctly. In any case, the output from trying to run the python starting program (after setting STEPLIB to include the PDSE with all the linked COBOL parts) is: $ python3 call_cobol.py Call cel4ro31 to run target program in AMODE 31 Error in CEL4RO31, retcode is 4 output: 7 Adding hlq.SCCRUN2 to the STEPLIB did not make a difference in the output. Peter “ax” Output from the LINK step of “call_cobol.c” module: XL_CONFIG=/usr/lpp/cbclib/xlc/etc/xlc.cfg:cc -v -Wl,DYNAM=DLL -Wl,lp64 -o./call_cobol.so call_cobol.o STEPLIB=NONE _C89_ACCEPTABLE_RC=4 _C89_PVERSION=0x42040000 _C89_PSYSIX= "_C89_L6SYSIX=SYS1.SCEELIB(CELQS003)" _C89_L6SYSLIB=SYS1.SCEEBND2:SYS1.SCCNOBJ:SYS1.CSSLIB //* c89 -------------------------------------------------------------- //LINKEDIT EXEC PGM=LINKEDIT, // PARM='AMODE=64,TERM=YES, // DYNAM=DLL,ALIASES=NO,UPCASE=NO, // LIST=OFF,MAP=NO,XREF=NO,INFO=NO,MSGLEVEL=4, // REUS=RENT,EDIT=YES,AC=0,CALL=YES,CASE=MIXED // ,DYNAM=DLL // ,LP64' //SYSLIB DD DSN='SYS1.SCEEBND2',DISP=SHR,DCB=DSORG=DIR // DD DSN='SYS1.SCCNOBJ',DISP=SHR,DCB=DSORG=DIR // DD DSN='SYS1.CSSLIB',DISP=SHR,DCB=DSORG=DIR //C8920 DD UNIT=SYSDA,SPACE=(32000,(30,30)), // STORCLAS=,MGMTCLAS=,DATACLAS=,DSNTYPE=, // DCB=(RECFM=FB,LRECL=80,BLKSIZE=3200) //C8921 DD DSN='SYS1.SCEELIB(CELQS003)',DISP=SHR,DCB=DSORG=NOTDIR //SYSPRINT DD PATH='/dev/fd1', // PATHOPTS=(ORDWR,OCREAT,OAPPEND),FILEDATA=TEXT, // PATHMODE=(SIROTH,SIRGRP,SIRUSR,SIWOTH,SIWGRP,SIWUSR) //SYSTERM DD PATH='/dev/fd2', // PATHOPTS=(ORDWR,OCREAT,OAPPEND),FILEDATA=TEXT, // PATHMODE=(SIROTH,SIRGRP,SIRUSR,SIWOTH,SIWGRP,SIWUSR) //SYSLMOD DD PATH='./call_cobol.so', // PATHOPTS=(OWRONLY,OCREAT), // PATHMODE=(SIRWXO,SIRWXG,SIRWXU) //SYSLIN DD * INCLUDE C8920 INCLUDE './call_cobol.o' INCLUDE C8921 /* “bx” Output from the LINK step of “call_cobol.c” module: FSUM0000I Utility(xlc) Level(D191018.Z2R4) FSUM0000I Utility(c89) Level(D190809.Z2R4) IEW2689W 4C40 DEFINITION SIDE FILE IS NOT DEFINED. FSUM3065 The LINKEDIT step ended with return code 4. From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of Sri Hari Kolusu Sent: Tuesday, July 9, 2024 6:21 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: python calling COBOL [was: RE: z/OS 3.1 Enhancements & Support News] >> test on our z/OS V2.5 system, but apparently the essential LE module >> CEL4RO31 does not exist on our system (or at least I nave not yet found it). Peter, CEL4RO31 is supported in V2R4 and higher . Do you have hlq.SCEERUN2 in your SYSLIB ? Thanks, Kolusu -- send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN