A vendor package written in C on a mainframe offers the ability to override part of its functions through user output. Provided C function prototype:
extern int SomeExit (void * Parameters, void * Record1, void * Record2, char ComparisonType, char * RankString, void * NotUsed1, int * NotUsed2)
Since we are primarily a COBOL store, I defined Enterprise COBOL 4.2 (as a DLL) to implement an exit trying to comply with the conventions in the IBM ILC manual ( https://www.ibm.com/support/knowledgecenter/en/SSLTBW_1. 13.0 / com.ibm.zos.r13.ceea400 / clcccb5.htm # clcccb5 ) and examples in this old SHARE view: http://www-01.ibm.com/support/docview.wss?uid=swg27003846&aid=1 , but the resulting program does not work because it causes an exit even before my DISPLAY message. My assumption is that I incorrectly declared the structures of the received data. The following is a snippet of my current test code (ignore my naming conventions - this is a prototype to prove the interface and will be rewritten to our own standards as soon as I have the main call).
IDENTIFICATION DIVISION. PROGRAM-ID. "SomeExit". ... LINKAGE SECTION. 01 WS-PARAMETERS-POINTER USAGE IS POINTER SYNCHRONIZED. 01 SORT-PASS-RECORD1-POINTER USAGE IS POINTER SYNCHRONIZED. 01 SORT-PASS-RECORD2-POINTER USAGE IS POINTER SYNCHRONIZED. 01 WS-COMPARISION-TYPE PIC X. 01 WS-RANK-STRING-POINTER USAGE IS POINTER SYNCHRONIZED. 01 WS-NOT-USED1-POINTER USAGE IS POINTER SYNCHRONIZED. 01 WS-NOT-USED2-POINTER USAGE IS POINTER SYNCHRONIZED. 01 WS-RETURN PIC S9(9) USAGE IS BINARY. ... PROCEDURE DIVISION USING BY VALUE WS-PARAMETERS-POINTER SORT-PASS-RECORD1-POINTER SORT-PASS-RECORD2-POINTER WS-COMPARISION-TYPE WS-RANK-STRING-POINTER WS-NOT-USED1-POINTER WS-NOT-USED2-POINTER RETURNING WS-RETURN. DISPLAY 'IN EXIT'. ... MOVE 0 TO WS-RETURN. GOBACK.
Cancel:
CEE3250C The system or user abend U 016 R=00000000 was issued. From entry point main at compile unit offset +00000192 at entry offset +00000192 at address 28500ECA.
Provider code dynamically calls a DLL. When I delete the DLL, I get a message saying that the output could not be found, and therefore it seems that the C code is trying to call it.
I tried the PROCEDURE DIVISION USING options, including removing BY VALUE using BY REFERENCE (although I understand that this is the default) and replacing the POINTERs with the actual structure definitions. I misunderstood the guide to structuring the parameters passed to the COBOL procedure?
Edit: I have a support ticket with the seller, but they have not yet responded with anything useful.
Thanks David
source share