none
Sending Data with TI .net client RRS feed

  • Question

  • Hi,

    I have a mainframe app that I talk to it via LU 6.2.  The problem is that I am sending that it (C.I.C.S.) reads fine.  However, the C.I.C.S. program expects to have the EIBFREE set to X 'FF' and I do not know how to do this.

     

    Help,

    Frank

    Monday, December 27, 2010 5:09 PM

Answers

  • Hi Frank

    Sure, I know Manfred well; you can tell him you've been talking to me in the forum. Manfred will know the right answer; if he says you need a SEND_DATA with the AP_SEND_DATA_DEALLOC_SYNC_LEVEL flag, then that's probably what you do need. It would certainly make sense, given the EIBFREE=X'FF' condition.

    However ... I have seem a few C# wrappers for APPC, but I don't have any examples to give you, myself. Maybe someone else in the Forum can help out?

    My own opinion, for what it's worth: C# is not a good language to use for APPC or even CPI-C programming. APPC and .NET use very different models and philosophies; most wrappers will be a kludge. For a heavy-duty, enterprise-style component, you'd really need to use C, or else C++. If you need to interact with a CICS program written using APPC, maybe you need to step back and re-think the whole problem space. Is this the best way to tackle the requirements? Are there better solutions? My current customer, for example, has re-written their mainframe applications to use TCP/IP instead of SNA. TI simplifies greatly the task of interacting with host applications, but at the loss of some flexibility; if the host app has particular requirements outside the mainstream "common case", then TI might not be the best solution.

    Other folks may have better info for you - I sure hope so!

    Good luck,

    Andrew

    --

    amclar at optusnet dot com dot au

    Friday, January 7, 2011 7:18 AM

All replies

  • Hi Frank

    In HIS 2004 and later, TI establishes a persistent session with CICS. Multiple transactions can be sent over that connection, without creating and tearing it down againover and over. But it sounds like your CICS app expects the LU6.2 session to be closed after the transaction completes - hence it wants the EIBFREE=X'FF'. You can't directly manipulate the EIB block from the TI Client; but you can get the transaction into the state that it will dellocate the APPC conversation, and thus (hopefully) meet the condition EIBFREE = X'FF'.  

    There are 2 main ways you can do this:

    1) free the .NET object which makes the call to CICS. Ths will close the connection to CICS (ie the LU6.2 session). You will need to re-instantiate the object when you make the next call; or 

    2) leave the object instantiated, but manualy control the session state in your .NET code. You can close the session by using the ClosePersistentConnection method; or by setting the COMTIContext CONNTYPE to OPEN or CLOSE, as required.  For more info, see this link:

        http://msdn.microsoft.com/en-us/library/aa704691(BTS.10).aspx

    Obviously the most efficient technique is to leave the object instantiated, but open and close the Connection as required by the CICS-end application. 

    You'd need to test this out and play around with it, a bit, to make sure it meets the requirements of your CICS app. There could be other variables and factors (such as EIBCONF, EIBRECV etc) which need to be satisfied.

    Other folks might also have more info for you.

    Hope it helps,
    Andrew
    -- 
    amclar at optusnet dot com dot au

    Tuesday, December 28, 2010 11:23 PM
  • Andrew,

    Thanks for the info, after reading the web page. I still am confured.  What I am trying to do is.  I am make a TI .net call to a CICS program via LU 6.2 SNA Userdata.  He is the real problem, I am sending a data area the contains 13 299 byte records.  All of these records redfines a filler area for a total of 3887 bytes.  Some of these records have packed data in them.  HIS2010 want to call them strings, ____ you know strings stops when you get x'00' So I wonderif I will have to convert them to EBCDIC myself.

    Any thought?

    Frank

    Wednesday, December 29, 2010 4:11 PM
  • Actually .NET Strings, just like the old BSTRs do NOT stop at a 0x00...only good old C(++) strings do. You should be able to twiddle the settings in Designer to have Strings "null terminated" or "blank padded" or something else which I can't remember (snow on the brain). Not too sure what you mean with "packed data", do you mean something like: I have a .NET array of bytes, which may contain a lot of strings which are null terminated, and/or other atomic data? If so, I think that TI will be hard pushed to do the conversion for you. If you mean: I have one long .NET String which may contain NULLs, then TI should be good with the right options.

    Note, as you say "convert them TO EBCDIC" (my emphasis), I am assuming this is a .NET to IBM conversion that you are talking about.

    Wednesday, December 29, 2010 5:45 PM
    Moderator
  • Hi Frank

    In addition to Rob's good info .... when you say "packed data", do you mean COMP-3 type data? If so, is the data already in packed decimal form on the .NET / PC side? Or are they ordinary Decimal, Int16 etc .NET data types, which will be put into records on the COBOL side?

    In the TI Project Properties in Visual Studio, you can define the host data types as COMP-3 and TI will do the packing for you. That is, it can convert "plain" PC-style integers into COMP-3 automatically, if that is what you define. If the data is already packed on the PC side, that's a bit more awkward.

    Make sure you open and study the basic SNA "GetAccount" sample projects from the HIS SDK, if you haven't already. They might make the data conversion a bit easier to follow (I was going to add a screenshot, but this new web forum format doesn't seem to allow attaching files, doh).

    Andrew

     

    Wednesday, December 29, 2010 11:25 PM
  • Andrew and Rob,

    Thanks for the info.  When I use the clientContext.ConnectionUsage = ConnectionTypes.PersistentOpen; as the sample says, then use clientContext.ConnectionUsage = ConnectionTypes.PersistentClose; for the last call.

    This doesn't set the  EIBFREE=X'FF' and I don't see anyway set this.  Anyway to set this?

    Frank

    Friday, December 31, 2010 11:18 AM
  • Hi Frank

    You can't actually write to EIBFREE from any process, outside the CICS task on the host which owns the EIB. This is true for any CICS client, whether it is Microsoft TI, IBM's own CUC, or even another CICS region on z/OS using DPL or FEPI. The EIB belongs to the CICS task which is running the transaction, and can only be updated via CICS API calls within that task.

    In other words, your actual goal isn't to directly write some value to the EIBFREE field. The CICS app which you are calling makes various APPC calls, which result in EIBFREE having a value of X'FF' - that is, the app wants to deallocate the APPC Conversation and free the resources. If you are using the User Input model in TI, then you need to organise your calling code on the Windows side so that it matches the expected conversation state of the partner TP in CICS.

    Generally, using the User Input model is harder than using the CICS LINK model - because you need to control all that conversation and session state, yourself. If there's any opportunity to use CICS LINK and communicate via the COMMAREA, that is much easier to program.

    Sorry I don't have a more helpful answer for you, but I hope this helps a bit. Let us know if you have follow-up questions. Other folks may have extra ideas too.

    Andrew

    --

    amclar at optusnet dot com dot au

    Saturday, January 1, 2011 3:24 AM
  • Andrew,

    I have no choice about what method to use.  I must use UserData.  I will be getting together with the VTAM/CICS guys tomorrow and let you know.

    Frank

    Sunday, January 2, 2011 3:42 PM
  • Thanks Frank,

    I've been thinking a bit more about your question (probably feeling a bit guilty, coz my last reply wasn't as helpful as I'd have liked :).

    You said the CICS program expects EIBFREE to be set to X'FF. Can you tell us more about that? Does the CICS app abend when you call it from the TI component? If so, what abend code? And/or does the app return some other form of error? For example, in the EIBERRCD field of EIB? Does the app use Syncpoint? What are the particular CICS commands which "expect" EIBFREE to be set to X'FF'?

    The EIBFREE field is set by commands such as EXEC CICS SEND and EXEC CICS RECEIVE.  EIBFREE=X'FF' means the exchange of data has been completed, and the CICS app is ready to DEALLOCATE the conversation, eg with an EXEC CICS SEND LAST or an explicit EXEC CICS DEALLOCATE. The TI Component needs to be in the right APPC conversation state to respond appropriately, to the CICS app's "desire" to end the conversation. In the User Input model, the programmer is fully responsible for managing the APPC conversation state - which is why it's a pain. It's not a shortcoming of TI, as such; just a by-product of a fairly complex programming model.

    To get better insight into what's happening under the covers, you could run the CICS app under CEDF while you call it from the TI object. Hitting PF4 in CEDF will show you the contents of the EIB fields following each CICS statement. If you combine that with an SNA Application trace from the HIS gateway, you'll get a pretty full picture of the APPC conversation state, as each command executes (easier said than done, sure: but CEDF and LU6.2 tracing has been used many times when developing TI apps; and indeed, developing CICS applications generally).

    In summary, if you can tell us a bit more about exactly how and why teh app wants EIBFREE=X'ff', we may be able to suggest some solutions.

    Let us know how you get on!

    Regards

    Andrew

    --

    amclar at optusnet dot com dot au

    Monday, January 3, 2011 3:14 AM
  • Ok,

    Here is the deal, the problem is that I need to use the WinAsyncAPPC stuff to do this.  my problem is I am a C# guy not a C++.  Has anyone converted Microsoft Host Integration Server 2010\SDK\Samples\NetworkIntegration\APPC from C++ to C#?

     

    Frank

    P.S. The Confirm is the EIBCONF and the Dealloc is the EIBFREE

    Monday, January 3, 2011 11:44 PM
  • Hi Frank,

    There's still not much info here to describe your problem scenario. Tell us more about what calls the CICS app is making, what it expects to happen, and what happens in your TI app. Does the CICS app hit an ATCV abend when you call it from TI? (an ATCV shows there was an incorrect APPC state transition).

    What do you mean by "the Confirm is the EIBCONF and the Dealloc is the EIBFREE"? Sounds like the an EXEC CICS SEND CONFIRM checks the EIBCONF field, and EXEC CICS DEALLOCATE checks EIBFREE - but I'm just guessing, without more details from you.

    You cannot mix TI and WinAPPC code in the one application. Maybe it sounded like I was suggesting that, when I said the programmer is responsible for controlling the conversation state in the User Input model. When you use TI, the TI Runtime handles ALL the APPC behaviour on the Windows side. You cannot override this with direct APPC calls of your own. You need to use the documented .NET methods and properties to control the .NET Component, such that the TI runtime will emit the right APPC verbs on your behalf. You need to make sure these correspond to the flow of conversation expected by the CICS app.

    You can use C# to call the WAPPC32.DLL functions. But that's not what you want. TI will already have an LU6.2 session set up between itself and the host end. If you invoke any APPC functions of your own, these would result in a second LU6.2 session carrying to totally different conversation state.

    I hope we can give you some help with this, but basically you'll need to give us more information to work with.

    Thanks,

    Andrew

    -- 

    amclar at optusnet dot com dot au

    Wednesday, January 5, 2011 9:39 PM
  • Andrew,

    I have been reading e-mails from a Manfred Mittermuller at Microsoft and hissays that we will have to use  AP_SEND_DATA_DEALLOC_SYNC_LEVEL to do what we want TI will not do what we want.

    Can you tell me how make WinAsnycAPPCEx calls from C#?

    Thanks,

    Frank

    Thursday, January 6, 2011 5:41 PM
  • Hi Frank

    Sure, I know Manfred well; you can tell him you've been talking to me in the forum. Manfred will know the right answer; if he says you need a SEND_DATA with the AP_SEND_DATA_DEALLOC_SYNC_LEVEL flag, then that's probably what you do need. It would certainly make sense, given the EIBFREE=X'FF' condition.

    However ... I have seem a few C# wrappers for APPC, but I don't have any examples to give you, myself. Maybe someone else in the Forum can help out?

    My own opinion, for what it's worth: C# is not a good language to use for APPC or even CPI-C programming. APPC and .NET use very different models and philosophies; most wrappers will be a kludge. For a heavy-duty, enterprise-style component, you'd really need to use C, or else C++. If you need to interact with a CICS program written using APPC, maybe you need to step back and re-think the whole problem space. Is this the best way to tackle the requirements? Are there better solutions? My current customer, for example, has re-written their mainframe applications to use TCP/IP instead of SNA. TI simplifies greatly the task of interacting with host applications, but at the loss of some flexibility; if the host app has particular requirements outside the mainstream "common case", then TI might not be the best solution.

    Other folks may have better info for you - I sure hope so!

    Good luck,

    Andrew

    --

    amclar at optusnet dot com dot au

    Friday, January 7, 2011 7:18 AM
  • Andrew,

    Thanks for the info, after reading the web page. I still am confured.  What I am trying to do is.  I am make a TI .net call to a CICS program via LU 6.2 SNA Userdata.  He is the real problem, I am sending a data area the contains 13 299 byte records.  All of these records redfines a filler area for a total of 3887 bytes.  Some of these records have packed data in them.  HIS2010 want to call them strings, ____ you know strings stops when you get x'00' So I wonderif I will have to convert them to EBCDIC myself.

    Any thought?

    -------

    Mr dich thuat

    Tuesday, June 7, 2011 4:09 AM