The Programmer's Reference makes it clear that in the XCTL command the LENGTH parameter is optional with the COMMAREA parameter. The LENGERR 22 RESP2 value 28 can set when the LENGTH is specified and is larger than the length of the COMMAREA field specified. If you leave off the LENGTH parameter the pre-compiler inserts a command before the CALL to move the LENGTH OF the commarea field. If you cannot specify a value for LENGTH that is larger, which is understandable, and the LENGTH does not need to be used when the LENGTH is equal to the length of the COMMAREA field, what is the purpose of the parameter unless you specify a smaller length than the COMMAREA field? There appears to be no documentation identifying that this is an option, and there is no LENGERR condition that would set if you coded the XCTL this way. Rather than just the receiving programs DFHCOMMAREA being defined smaller than the XCTL COMMAREA field, with the intent of only referencing a subset of the COMMAREA, can't you specify a smaller LENGTH in the sending programs XCTL as well? It would certainly make it clear to other programmers that the intention is to send the subset of data and receive the subset of data, rather than seeing a mismatch of field sizes between the sender and receiver.
Any feedback is greatly appreciated. Thank you.