A Session Integrator application that uses the LU0 programming interface returns the following error when it receives a response from a mainframe application:
Message : The Function Management Header returned from the Host contained an invalid Length.
Error Code : Microsoft.HostIntegration.SNA.Session.SessionStatus.FMHLengthError”
This problem occurs when a mainframe application sends data to Session Integrator that has the Function Management Header (FMH) bit in the Response Header (RH) set to 1. This setting indicates that one or more function management (FM) headers are included in the response. In the situation that is described in the "Symptoms" section, the response from the mainframe does not include any FM headers. This causes the response to be parsed incorrectly. This parsing problem causes the error.
Cumulative update information
The fix that resolves this problem is included in Cumulative Update 2 for Host Integration Server 2013.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
After you apply this update, you can control Session Integrator’s parsing of FM headers by using a configuration option in the LU0 programming interface. By default, Session Integrator tries to parse FM headers if the FMH bit is set in the Response header.
If the Session Integrator LU0 application uses a connection string to connect to the IBM mainframe, the following parameter can be added to the connection string to disable FMH parsing:
The following is an example of a connection string that has this new property added:
_session.Connect("FUNCTIONMANAGEMENTHEADERS=NONE;LogicalUnitName=" + LUName.Text, SessionLU0InitType.SSCP);
Note This connection string is based on the connection string that is used in the LU0NET Session Integrator sample that is included in the Host Integration Server 2013 SDK.
If the FUNCTIONMANAGEMENTHEADERS property is not included in the connection string, or if the property is set to FUNCTIONMANAGEMENTHEADERS=INCLUDE, and if the FMH bit is set to 1, Session Integrator tries to parse FM headers in the data that it receives from the IBM mainframe application.
If Session Integrator uses the SessionConnectionLU0 Class to specify the connection properties to use when it connects to the IBM mainframe system, FM Header parsing is controlled by using the following property:
FunctionManagementHeaderSupportThe new FunctionManagementHeaderSupport property supports the following values:
FunctionManagementHeaderSupport.NoneThe following is an example of how to use the SessionConnectionLU0 Class to specify an LU Name, Host Code Page and to disable the parsing of FM headers:
SessionConnectionLU0 _connection = new SessionConnectionLU0();
_connection.LogicalUnitName = LUName.Text;
_connection.HostCodePage = 37;
_connection.FunctionManagementHeaderSupport.None;If the FunctionManagementHeaderSupport property is not specified, the default behavior is that Session Integrator parses FM headers in any response that is received from the IBM mainframe application if the FMH bit is set to 1.
The third-party products that this article discusses are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, about the performance or reliability of these products.