Topic
  • 13 replies
  • Latest Post - ‏2013-06-24T14:17:52Z by Josh_Winwood
poz
poz
6 Posts

Pinned topic Setting LUName in a HATS host session

‏2012-05-22T13:38:44Z |
Hi,
I am using HATS 8 to reface a System Z COBOL/CICS application. The customer needs HATS to set specific LUName based on the location of the client machine from which the user access the host (just like the Emulator is set right now). Does anyone have any hint on how to do it?
Updated on 2012-05-22T13:46:19Z at 2012-05-22T13:46:19Z by tmparker
  • tmparker
    tmparker
    534 Posts

    Re: Setting LUName in a HATS host session

    ‏2012-05-22T13:46:19Z  
    Hi,

    You have the ability to override connection parameters, such as LUName, in HATS. You can read more about this feature here: http://www-01.ibm.com/support/docview.wss?uid=swg21251884.

    Thanks
    Tim
  • Josh_Winwood
    Josh_Winwood
    13 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-05-24T18:41:17Z  
    • tmparker
    • ‏2012-05-22T13:46:19Z
    Hi,

    You have the ability to override connection parameters, such as LUName, in HATS. You can read more about this feature here: http://www-01.ibm.com/support/docview.wss?uid=swg21251884.

    Thanks
    Tim

    I have a similar situation in which some of our CICS applications depend on the connecting machine's access.  I am able to set the LUName using an HTTP session variable, which I set with <input type="hidden" name="hatsgv_whatever" value="something"> within a servlet that accesses an SQL database which maps the client to the LUName in the database, then directs them to the hats server/application they want.  (note that you must enable global variable overrides on the other tab in project settings).

    I have found that this will connect them using the specified LUName, however, if that LUName is already in use, it will assign them the next available LU in the pool.  This is an issue since I will be giving different PTerms, I think it is, to different LU's within the pool.  Any idea on how I can prevent connection unless the specified LU is available?

     

    Thanks,

    Josh

    Updated on 2013-05-24T19:35:00Z at 2013-05-24T19:35:00Z by Josh_Winwood
  • tmparker
    tmparker
    534 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-05-29T16:05:40Z  

    I have a similar situation in which some of our CICS applications depend on the connecting machine's access.  I am able to set the LUName using an HTTP session variable, which I set with <input type="hidden" name="hatsgv_whatever" value="something"> within a servlet that accesses an SQL database which maps the client to the LUName in the database, then directs them to the hats server/application they want.  (note that you must enable global variable overrides on the other tab in project settings).

    I have found that this will connect them using the specified LUName, however, if that LUName is already in use, it will assign them the next available LU in the pool.  This is an issue since I will be giving different PTerms, I think it is, to different LU's within the pool.  Any idea on how I can prevent connection unless the specified LU is available?

     

    Thanks,

    Josh

    Unfortunately HATS does not control the assignment of the LUName, this is done by the host.  I'm not sure if there is a setting on the host that tells it to fail if the LUName is already in use instead of assigning it another one.  That you would have to investigated from that side of things as I don't know the answer to it.

    From the HATS side the only thing I can think of to try and control this would be to add some custom business logic code that runs right after the connection is made that would compare the LUName assigned to the new session with the one you specified.  This would require you to store the LUName you are requesting in a global variable and then you could pull the LUName from the session in the code and compare them.  If they are different then you could disconnect the session right there.

    Thanks

    Tim

  • giocot
    giocot
    5 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-05-31T07:28:47Z  

    I have a similar situation in which some of our CICS applications depend on the connecting machine's access.  I am able to set the LUName using an HTTP session variable, which I set with <input type="hidden" name="hatsgv_whatever" value="something"> within a servlet that accesses an SQL database which maps the client to the LUName in the database, then directs them to the hats server/application they want.  (note that you must enable global variable overrides on the other tab in project settings).

    I have found that this will connect them using the specified LUName, however, if that LUName is already in use, it will assign them the next available LU in the pool.  This is an issue since I will be giving different PTerms, I think it is, to different LU's within the pool.  Any idea on how I can prevent connection unless the specified LU is available?

     

    Thanks,

    Josh

    Hi Josh

    i read your post and as in past i also tried to use this tecnique to set LUName, but without success, premised that I know just a little java and Htlm, i  would be you thankful if if you could explain me , in a form more detailed, as you have done for setl  LUName.

    Thanks in advance

  • Josh_Winwood
    Josh_Winwood
    13 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-05-31T13:03:31Z  
    • tmparker
    • ‏2013-05-29T16:05:40Z

    Unfortunately HATS does not control the assignment of the LUName, this is done by the host.  I'm not sure if there is a setting on the host that tells it to fail if the LUName is already in use instead of assigning it another one.  That you would have to investigated from that side of things as I don't know the answer to it.

    From the HATS side the only thing I can think of to try and control this would be to add some custom business logic code that runs right after the connection is made that would compare the LUName assigned to the new session with the one you specified.  This would require you to store the LUName you are requesting in a global variable and then you could pull the LUName from the session in the code and compare them.  If they are different then you could disconnect the session right there.

    Thanks

    Tim

    Thanks Tim,

    I learned that it is possible to set up on the host to only allow the LUName specified, but not sure if we can do it on our system.  It may be the definition of a pool to select the next available LU.  I will post an update once I talk to my system people.  Otherwise, thanks for the suggestion using business logic - it shouldn't be too difficult to code, since our logon screen displays LUName, but I hope that it's as easy at setting up a rule on the host.

     

    Josh

  • Josh_Winwood
    Josh_Winwood
    13 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-05-31T13:17:00Z  
    • giocot
    • ‏2013-05-31T07:28:47Z

    Hi Josh

    i read your post and as in past i also tried to use this tecnique to set LUName, but without success, premised that I know just a little java and Htlm, i  would be you thankful if if you could explain me , in a form more detailed, as you have done for setl  LUName.

    Thanks in advance

    Hi Gio,

    On what type of page are you putting the HTML code <input type="hidden" name="hatsgv_LUName" value="something">?  I am putting this within the <body> tag of a .jsp servlet I am hosting within the HATS project within the Web Content folder.

    Double click on "main" under connections from your HATS Project list, click on the Advanced tab, and under "LU or Pool Name" select "Use an HTTP session variable" and enter the variable name you are setting.  In my example in this post, I would enter LUName.  If you do not see the "LU or Pool Name" box on the left of the advanced tab, go to the Basic tab and check if there is another Type you can select for your host.  I am connecting to a 3270 machine, but must select 3270E in order to add that LUName http session variable.

    Under your HATS Project list, double click on Project settings, and go to the other tab.  Here, you must either select the radio button "Allow all global variables to be overrideen by client requests" or specifically add the variable you are using to the allow list below.

    From my .jsp page that sets the LUName hidden parameter in the HTML code, I have code that redirects to my HATS project link (where you get sent when you right click on your HATS project and select run on server).  Alternatively, you can just put in a link to your HATS project; this should work as well.

    Hope this helps.  Let me know if you have any other questions.

     

    Josh

  • Josh_Winwood
    Josh_Winwood
    13 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-06-20T15:51:36Z  
    • giocot
    • ‏2013-05-31T07:28:47Z

    Hi Josh

    i read your post and as in past i also tried to use this tecnique to set LUName, but without success, premised that I know just a little java and Htlm, i  would be you thankful if if you could explain me , in a form more detailed, as you have done for setl  LUName.

    Thanks in advance

    Note that you have to put the <input> within a <form> tag.  I have it working for setting the LU, but I am unable to access it as a Global Variable from a future transformation, it just comes up Null.. any suggestions would be appreciated.  I am trying to pull it into the JSP using:

    IGlobalVariable gvLUName = ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("LUName");

    then if not null, setting a string to the value of gvLUName.getString() 

     

    Josh

  • tmparker
    tmparker
    534 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-06-21T04:44:10Z  

    Note that you have to put the <input> within a <form> tag.  I have it working for setting the LU, but I am unable to access it as a Global Variable from a future transformation, it just comes up Null.. any suggestions would be appreciated.  I am trying to pull it into the JSP using:

    IGlobalVariable gvLUName = ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("LUName");

    then if not null, setting a string to the value of gvLUName.getString() 

     

    Josh

    Hi Josh,

    It's hard to say what's not working for you because I'm not quite clear on the setup of your application or when and where the global variable is being set and retrieved.  If you are trying to access the GV and it's coming back null then my guess it that it didn't get set correctly.  Again, I don't know how the GV was getting set in the first place so I don't know if there is a problem there.  I can say that everything you are trying to do does work and I have done it before.  It sounds like you just need to debug a few things and determine what part is failing.

    Thanks

    Tim

  • Josh_Winwood
    Josh_Winwood
    13 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-06-21T13:10:34Z  
    • tmparker
    • ‏2013-06-21T04:44:10Z

    Hi Josh,

    It's hard to say what's not working for you because I'm not quite clear on the setup of your application or when and where the global variable is being set and retrieved.  If you are trying to access the GV and it's coming back null then my guess it that it didn't get set correctly.  Again, I don't know how the GV was getting set in the first place so I don't know if there is a problem there.  I can say that everything you are trying to do does work and I have done it before.  It sounds like you just need to debug a few things and determine what part is failing.

    Thanks

    Tim

    Thank Tim.

    I have a hunch why it's not being set.. I am trying to set the GV before HATS is ever started, through a servlet I have within the project running on the WAS server.  So I'm thinking that maybe since the HATS application isn't running yet, that it isn't retaining the variables.  But somehow HATS is able to see the entry variable in order to set the LUName, but once I'm in a transformation the GV does not contain the data.

  • tmparker
    tmparker
    534 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-06-21T18:26:00Z  

    Thank Tim.

    I have a hunch why it's not being set.. I am trying to set the GV before HATS is ever started, through a servlet I have within the project running on the WAS server.  So I'm thinking that maybe since the HATS application isn't running yet, that it isn't retaining the variables.  But somehow HATS is able to see the entry variable in order to set the LUName, but once I'm in a transformation the GV does not contain the data.

    Can you show me exactly how you are passing in the LUName and then how you are trying to store it?  Also, do you have the option enabled in the project settings to allow global variables to be overridden by client requests?

  • Josh_Winwood
    Josh_Winwood
    13 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-06-21T18:54:55Z  
    • tmparker
    • ‏2013-06-21T18:26:00Z

    Can you show me exactly how you are passing in the LUName and then how you are trying to store it?  Also, do you have the option enabled in the project settings to allow global variables to be overridden by client requests?

    <INPUT name="hatsgv_LUName" size="8" type="HIDDEN" value="XXXXXXXX"> is how I am setting through the Servlet page.. then when trying to receive it I do:

     

    IGlobalVariable gvLUName = ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("LUName");

    then if gvLUName !null:

    String checkThis = gvLUName.getstring(0);

    it just comes up null.. I have found a work around by using a static java variable then importing the servlet into my transformation and doing a String whatever=servlet.variableName

  • tmparker
    tmparker
    534 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-06-21T19:30:03Z  

    <INPUT name="hatsgv_LUName" size="8" type="HIDDEN" value="XXXXXXXX"> is how I am setting through the Servlet page.. then when trying to receive it I do:

     

    IGlobalVariable gvLUName = ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("LUName");

    then if gvLUName !null:

    String checkThis = gvLUName.getstring(0);

    it just comes up null.. I have found a work around by using a static java variable then importing the servlet into my transformation and doing a String whatever=servlet.variableName

    When you say you are setting the value through the Servlet page, is that in the HATS jsp or some other web app you have?  The hatgv_ syntax will only work on pages that HATS processes.

  • Josh_Winwood
    Josh_Winwood
    13 Posts

    Re: Setting LUName in a HATS host session

    ‏2013-06-21T19:47:38Z  
    • tmparker
    • ‏2013-06-21T19:30:03Z

    When you say you are setting the value through the Servlet page, is that in the HATS jsp or some other web app you have?  The hatgv_ syntax will only work on pages that HATS processes.

    It's another web app that is running within the HATS project.. I had a feeling that since the HATS application hasn't yet started executing that the hatsgv_ wasn't setting a GV. I thought that it was, however, setting my LUName for connection to the host.. I better double check.

    Thanks for the help.

    Josh