Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I script for a session with no live CICS connection? 1

Status
Not open for further replies.

clwyddavis

Programmer
Nov 8, 2002
5
US
I support an application that uses EXTRA 6.5 to connect to our mainframe and send keys and text emulating a CICS update transaction. This is installed on a single machine. The scheduler launches the application every 15 minutes from 6:30am to 6:15pm. The app (VB6) grabs an EXTRA session named HOST1 which is launched at Startup so it is running all day. Then the app instantiates a System, Session and Screen object using the existing HOST1 session. When it concludes all objects are set to Nothing. This works fine until about 9:30 pm when the CICS partition is closed for batch processing. When CICS comes back up the HOST1 Session Window is open but there is nothing in it. The scheduled application fails until the HOST1 session is started manually. How do I script for the HOST1 session being real or empty? I would like for the VB app to be able to respond either way.

ClwydDavis
Cease the Day
 
Have you tried???


If MyScreen.OIA.ConnectionStatus = 1 Then
MsgBox "This session currently connected to a mainframe application."
ElseIf MyScreen.OIA.ConnectionStatus = 3 Then
MsgBox "This session is not connected to a mainframe application."
End If


[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Or open the session through your vb app.

Dim objExtraSession As Object
Set objExtraSession = CreateObject("Extra.System").Sessions.Open("YourPath.adp")

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
Thanks for both replies. With no manual on this I am like a person afraid to go into a cave any further than what I can see by the light from the entrance. To extend the analogy, you have illuminated the problem quite a bit.

The following bits of code further illustrate the problem. Regarding your suggestion of opening the session in code, this is already the case. Researching this, I can see that the session launched on bootup is not necessary. I deleted
this session a new session was created successfully. The application code ran to nomal EOJ. The CICS Menu remains. Even though I kill the objects I am not closing the actual CICS screen which remains open. When CICS goes down the session hangs there with no connection. The next time the objects are created the VB app continues to wait for the String "TN3270" that tells it to continue the logon.

I thought about using your suggested coding to interrogate the session before doing something but then I am already in the new session. It seems like a "chicken or egg" first scenario. I think I would be okay if I could detect
an existing session and use the Quit method to close the open window. This raises a Dialog box to confirm Ending the session which is running unattended.

More chicken and egg.

[blue]'============ EXTRA Login =======================
Function LoginToExtra() As Boolean
ModUtils.ProgressHook "OpenForm", "Logging into the Host...", 0

Set myApp = CreateObject("Extra.System")
Set mySession = myApp.Sessions.Open("C:\Program FILES\E!PC\SESSIONS\HOST1.EDP")
Set myScreen = mySession.Screen
' Set the Success value to NO.
LoginToExtra = False
mySession.Visible = True
' We will leave this function after any failure.
If Not MyWaitForString("TN3270", 2, 34) Then
Exit Function
End If
'----------------------------------------------------
VIRGINIA FARM BUREAU
TN3270 MENU
HELPDESK XXX-XXX-XXXX OR XXXX
LUNAME:XXXXXXXX IP XXX.XXX.XXX.XXX


'-----------------------------------------------------------

Sub Quit_Session()
myScreen.SendKeys "CSSF LOGOFF"
myScreen.SendKeys "<ENTER>"

Set myScreen = Nothing
Set mySession = Nothing 'added 09/01/2005 - memory leak - cdavis
' myApp.Quit
Set myApp = Nothing

End Sub [/blue]






ClwydDavis
Cease the Day
 
I think I would be okay if I could detect an existing session and use the Quit method to close the open window.
Code:
Sub CloseAllSessions()
 
  Dim HangingSessions As Object  
  
  Set HangingSessions = CreateObject("EXTRA.System")
  HangingSessions.Sessions.CloseAll
 
  Set HangingSessions = Nothing

End Sub

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
I will try that. Hope I have better luck than "HangingChads"!

[cheers]



ClwydDavis
Cease the Day
 
Woe is me. That method still requires confirmation of closing session.

Thanks

[sadeyes]



ClwydDavis
Cease the Day
 
How about this:
Code:
Sub FlamingDeath()

  Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
  Set colItems = objWMIService.ExecQuery("Select * from Win32_Process where Name='EXTRA.exe'", , 48)
  For Each objItem In colItems
    objItem.Terminate
  Next

End Sub

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
TO: MrMilson

Sorry to be so tardy in reply. I have VB6, VS2003 and VS2005 installed. The application is written in VB6. I don't seem to be able to come up with the correct mix of references for the FlamingDeath() solution to compile. Plus I don't have a CICS partition I can experiment with. I am trying a VB6 approach from a different direction. All prior recommendations that involved closing everything down trigged a dialog box which required a response. I tried to find out more about the troublesome session and found that while the status log text indicated inability to connect, the status bar said something like "connecting". I inferred that as long as it was trying that it counted as a connection. My attempted solution is to test any session I find at startup of the app. If there is a session and the screen is not what I am looking for, I do an object.disconnect and object.reconnect. It works with the scenarions I have tested. Since I can't explicitly duplicate the problem session things are going a little slow. I am trying to look at the session remotely from home each night and monitor its progress during the following morning. My only test so far was clobbered by some unknow error. So it goes. Thanks for your help so far.

ClwydDavis
Cease the Day
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top