To resolve this, follow these steps:
(Another gotcha is if you've created a 32 bit Server, but 64 bit shared objects or vice versa)
16:36:04.793 MF.RTS 251 3 : 8 "ZZZIWCS.so" "ZZZIWCS.so: undefined symbol: TRCIWWR" 16:36:04.793 MF.RTS 6 1 : 81 16387 "idamjrm" "MVS_JOB_STEP_RESOURCE_MGR"
To find the meaning of the numbers in bold, use a text editor to open the MF.RTS.xml file located in $COBDIR\etc\mftrace\annotations/opt/microfocus/EnterpriseDeveloper\etc\mftrace\annotations. Once open, find the line showing an event ID of the same first number For example:
<Event Id="251" Description="Program Load Error">
Then find the line with the argument case index that matches the second number. For example:
<ArgumentCase Index="0" Value="8" Description="Error (DLL_LOAD_FAIL)"/>
This example shows that a DLL load failed for the shared object ZZZIWCS.so with the reason specified in the original message: undefined symbol: TRCIWWR
Common causes for this issue are:
LINK /EDIT /STACK:8000000,8000000 cassi.exe
WRITE FILE(LEGUPT) FROM (LOADREC);
Where LEGUPT and LOADREC were declared as:
DCL LEGUPDT FILE RECORD OUTPUT ENV(VB RECSIZE(804)); DCL LOADREC CHAR(800) VARYING;
Investigation of the failure via the ONCODE() value in the ON ERROR unit showed an ONCODE() value of 99150, indicating that a RECORD condition had been raised. This did not appear to be possible because only 331 bytes were being written to this file.
Further investigation uncovered three salient facts:
A PLI CHAR VARYING consists of a two-byte LL in platform native format (in this case, little endian format) followed by an area that is long enough to contain the longest possible string. Because the overlay redefined the CHAR VARYING and a provided a default for FIXED BIN(xx) data types of BIGENDIAN, the assignment of 331 resulted in a length of 19201 (x'4B01') being passed into the PL/I Runtime System. This immediately triggered an ON RECORD condition because 19201 bytes cannot be written to a file defined as having a maximum LRECL of 804.
Solution: Add the NATIVE attribute to the structures used to overlay the CHAR VARYING, which makes them LITTLEENDIAN. For example:
DCL 1 SCARLEG UNALIGNED BASED(P_SCARLEG), 2 RECLEN FIXED BIN(15) NATIVE, /* RECORD LENGTH */ ... ... DCL 1 OTEXT UNALIGNED BASED(P_TEXT), 2 TEXTLEN FIXED BIN(15) NATIVE, ... ...
Below are examples a valid UNDEFINEDFILE message when compiled with -defext vs the same example when compiled w/o -defext. (The customer's failure to properly compile with -defext can manifest itself in a wide variety of issues such as traps, etc as the file control blocks are not allocated and the memory being used is undefined)
*MSG ONCODE 99140: The UNDEFINEDFILE condition was raised because a DD statement was not used in (FILE=MYFILE)
*MSG ONCODE 99140: The UNDEFINEDFILE condition was raised because a DD statement was not used in (FILE=)