Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: A new feature in the COM Transaction Integrator gives the client program full control over a TRM request and lets the client program process the TRM reply


View products that this article applies to.

Summary

Using the Microsoft Component Object Model (COM) Transaction Integrator (COMTI) to access Customer Information Control System (CICS) programs on the mainframe over TCP/IP involves first sending a Transaction Request Message (TRM) and then receiving a TRM reply from the mainframe before exchanging the program data. Previously, the COMTI runtime automatically formatted the TRM request and then processed the TRM reply. This meant that the client program had no control over the TRM request and could not receive the contents of the TRM reply. COMTI now includes a new feature that gives the client program full control of the TRM request and lets the client program process the TRM reply. For more information about how to use this new feature, see the "More Information" section.

↑ Back to the top


Resolution

Service pack information

This feature is available in the latest service pack for Microsoft Host Integration Server 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
328152 How to obtain the latest service pack for Host Integration Server 2000

Hotfix information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version    Size     File name
   ------------------------------------------------------------
   04-Jun-2003  14:01  5.0.0.915   37,136  Capture.dll
   04-Jun-2003  14:01  5.0.0.915  323,856  Cedrmsgs.dll
   04-Jun-2003  14:01  5.0.0.915   33,040  Comticontext.dll
   04-Jun-2003  14:01  5.0.0.915  147,728  Convert.dll
   04-Jun-2003  14:01  5.0.0.915   74,000  Convertprim.dll
   04-Jun-2003  14:01  5.0.0.915   33,040  Dpl1.dll
   04-Jun-2003  14:01  5.0.0.915  823,568  Dtcob390.dll
   04-Jun-2003  14:01  5.0.0.915   37,136  Playback.dll
   04-Jun-2003  14:01  5.0.0.915   78,096  Readlib.dll
   04-Jun-2003  14:01  5.0.0.915  123,152  Tadtlb.dll
   04-Jun-2003  14:01  5.0.0.915  114,960  Tagen.dll
   04-Jun-2003  14:01  5.0.0.915   82,192  Tranlu62.dll
   04-Jun-2003  14:01  5.0.0.915  110,864  Trantcp.dll
   04-Jun-2003  14:01  5.0.0.915   49,424  Turnaround.dll
   04-Jun-2003  14:01  5.0.0.870  950,272  Componentbuilder.exe
   28-Mar-2003  06:15             838,423  Comticb.chm
   28-Mar-2003  06:15             812,988  Resnapin.chm

Note Because of file dependencies, the most recent fix that contains these files may also contain additional files.

↑ Back to the top


More information

Information for the TRM request or the TRM reply, or both, is passed to the COMTI runtime through an optional parameter that contains an array of data. Formatting for the TRM request and the TRM reply is defined within the user-defined type definitions in the COMTI type library. The name of the user-defined type must start with the characters TRMIN for the TRM request and TRMOUT for the TRM reply. This prefix is case sensitive. TRM requests and TRM replies may have multiple user-defined type definitions. For example, you may have the following user-defined type definitions:
  • TRMINExample1
  • TRMINExample2
  • TRMINExample3
  • TRMOUTSample
The format must match with the format that is used in the Concurrent Server program or Concurrent Server programs on the mainframe.

COMTI includes sample Concurrent Server programs that use the default format that the COMTI runtime will process automatically. You can use the Mscmtics.cbl program with the TCP/IP Link model. You can modify the Tcpcdrbk.cbl sample, the Tcpcgtac.cbl, and the Cicscs.cbl sample for use with the Concurrent Server (non-Link) model. The example in this section uses the TRM request format that is programmed in the Mscmtics.cbl sample and calls the sample cedrbank method that is used in the CedarBank tutorial that is included with COMTI.

When sending the TRM request, the IBM listener expects a four-byte string with the CICS Transaction Name for the Concurrent Server program and then a one-byte FILLER that typically contains a comma. Then, in the Mscmtics.cbl sample, the format of the TRM request after the fifth byte is the following:
01 CLIENT-IN-DATA                    PIC X(35).
01 FILLER REDEFINES CLIENT-IN-DATA.
          05 CID-USERID                     PIC X(8).
          05 CID-PASSWORD                   PIC X(8).
          05 CID-LINK-TO-PROG               PIC X(8).
          05 CID-COMMAREA-LEN               PIC S9(4) COMP.
          05 CID-RESERVED                   PIC X(9).
To give the client program full control over the data that is sent in the TRM request, you must add the following user-defined type to the COMTI type library:
UDT Name: TRMINSample (where 'Sample' can be any text)
UDT Members (the Member names that are specified here are for sample purposes):
   TranID � String � PIC X(4)
   CommaDelim � String � PIC X
   MyUserID � String � PIC X(8)
   MyPassword � String � PIC X(8)
   LinkProg � String � PIC X(8)
   CommLen � Integer � PIC S9(4) COMP 
            (with a Trailing FILLER of 9 on the COBOL Definition tab for CommLen)
As soon as the COMTI type library is saved and installed into a COM+ application package, you must enable the TRM reply feature in the client program. To do this, follow these steps:

Note This code sample is in Microsoft Visual Basic .NET.
  1. In your Visual Basic .NET project, add a COM reference to the following file:
    \Program Files\Host Integration Server\System\Comticontext.dll
  2. Add a COM reference to the COMTI type library. To do this, run the Assembly Registration tool (Regasm.exe) against the Interop.FileName.dll file that is created in the Bin folder for the project. This registers the interop assembly in the global assembly cache. To do this, follow these steps:
    1. Click Start, point to All Programs, point to Microsoft Visual Studio .NET 2003, point to Visual Studio .NET Tools, and then click Visual Studio .NET Command Prompt.
    2. Open the Bin directory for the project, and then run the following command:
      regasm interop.FileName.dll
In the Visual Basic .NET project, the following code is used:
        Dim objCedar As New COMTI.TRMSample
        Dim ctxArray() As Object
        Dim objCOMTIContext As New COMTICONTEXTLib.ContextObject
        Dim udtTRMIN As COMTI.TRMINSample

        ' Fill the user-defined type with the values to send to the mainframe.
        udtTRMIN.TranID = "MSCS" ' Transaction to execute on the Host.
        udtTRMIN.CommaDelim = ","
        udtTRMIN.MyUserID = "MFUSERID"
        udtTRMIN.MyPassword = "PASSWORD"
        udtTRMIN.LinkProg = "CEDRBANK" ' The CICS Link to the program name.
        udtTRMIN.CommLen = 41 ' The number of bytes in the COMMAREA.

        ' Write the user-defined type to the COMTI Context Array.
        ' First parameter: string with the exact name of the typelib user-defined type.
        ' Second parameter: the Visual Basic user-defined type that contains the data.
        ' Third parameter: the array object to write the data to.
        objCOMTIContext.WriteContext("TRMINSample", udtTRMIN, ctxArray)

        Dim Name As String
        Dim Acc As String
        Dim Bal As Decimal
        Name = "Jane"
        Acc = "1234"
        Bal = 0

        ' Make the COMTI method call. The last parameter is the optional
        ' COMTI Context Array parameter.
        objCedar.cedrbank(Name, Acc, Bal, ctxArray)
To view the TRM reply, a user-defined type must be defined in the COMTI type library with a user-defined type name that begins with TRMOUT. You must define a variable within the Visual Basic project for that user-defined type and you must call the WriteContext method with the following three parameters:
  • The exact user-defined type name in the COMTI type library (case sensitive)
  • The Visual Basic variable for the user-defined type
  • The context array object
When the COMTI method call is made with the optional context array parameter, the data from the TRM reply is passed back to the program in the Visual Basic variable for the user-defined type. For the TRMOUT user-defined type, the format may include a first data item that is numeric. This indicates the length of the message. In the COMTI Component Builder properties for the TRMOUT user-defined type, you can choose one of the following three options if the first data item is numeric:
  • No length specifier present
  • Length specifier includes self
  • Length specifier excludes self

↑ Back to the top


Keywords: KB810956, kbhotfixserver, kbprb, kbhis2000fix, kbqfe, kbinfo

↑ Back to the top

Article Info
Article ID : 810956
Revision : 3
Created on : 9/27/2005
Published on : 9/27/2005
Exists online : False
Views : 587