I have defined the DFHCOMMAREA in the linkage section as X(49). The return statement in my program passes the COMM area data which is of size greater than 49. But the program does not abend and seems to work just fine with access to all the data which was sent last time using the following Move statement.
MOVE DFHCOMMAREA(1:EIBCALEN) TO WS-WORKAREA
How can this work? Is the size defined in the linkage section of no significance?
True, the size of the 01 in linkage is of no real significance. The data description in linkage allows the program to access the data directly. The main use it the address of the 01 dataname, a pointer to the data. Your MOVE take advantage of that address and relies on CICS for the length.
Joined: 23 Mar 2007 Posts: 149 Location: Ottawa Canada
There are LE runtime options that, when turned on, will cause LE to verify that your reference modifications are within the bounds of the variable referenced.
In other words, I think your code will abend if the system administrators were to turn these options on. Where I work, they turned them on about 4-5 years ago. I just made a trip through Abend-FX and was able to find a 1072 (IGZ0072S).
Safer and cleaner to make sure your DFHCOMMAREA is big enough to reference the entire area. Even if it works for you now...