Results 1 to 7 of 7

Thread: How Connect Mainframe??-Urgent

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Location
    Istanbul-Turkey
    Posts
    9

    How Connect Mainframe??-Urgent

    I have to write a program which connect main frame via an Extra! Sesson,then enters application name which is ALCS,and then I enter a command and I get its result to VB program. So firstly I have to run Extra! program,and then connect session and then connect Applicatin named ALCS.After that, I send a command to ALCs and I get it's result.

    Is there any one help me about this?

  2. #2
    Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    36
    First you need to run an Extra Session you have setup, with the machine name, port etc. This session should be *.edp

    I dont understand exactly what you want to do here....
    but you can recognize specific mainframe pages using Extra, and kick off an Extra macro when a user goes to a particular screen, or even navigate between screens via a macro. (Extra macros use an older versin of VB - still does most things though)

    You can get data from the screen using a Session object... something like this :
    Sess0.Screen.GetString(1,1,10)
    (first 10 chars from position 1,1)

    I have some examples which do a few different things if you are still interested.

    BG

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Location
    Istanbul-Turkey
    Posts
    9

    Re: How Connect Mainframe??-Urgent

    Thank you very very much for your interest. I know,I could not explain my problem exactly. My program will start a session and enters ALCS. (ALCS is a software interface between application programs and the MVS/ESA operating system. It runs as a job or started task under MVS/ESA, providing real-time transaction processing facilities for airlines, banks, hotels, and other industries that generate high transaction rates and require fast response times and high system availability.) So,I have to send a message to session in order to connect ALCS. And than I will send another message -which is an ALCS command- and I get is result back to VB.

    I will really pleased if you send me examples,I really need them.

    Brgrds
    Burcu

  4. #4
    Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    36
    OK, so you can start the Extra Session via your program ? This should be the easy part.....

    Then I think what you will need to do is start an Extra Macro,
    (If you go into Extra, then Options -> Settings, then select Macro option. You can select your Extra macro which will start automatically upon start of Extra)
    from which you can start your required transaction (ALCS?....I am assuming this part I have never sent things to the Mainframe... only recieved them) Extra should come with some good examples of this part.
    I am not at work today and tomorrow, perhaps I can look further for you on Wednesday when I can look at my code.

    Once this ALCS has started and done what you want (If you want to send parameters to an Extra macro, and therefore ALCS...this may be difficult, you may have to pass them through a file)

    You can then recognise a Mainframe screen (Using Tools -> record pages), and kick off another Macro (Using Tools -> Page Settings) which can get information from known locations on the screen.

    This probably does not make much sense to you yet, I struggled with mine for several weeks, and as I said I am not at work till Wednesday and cannot look at references till then.

    BG

  5. #5

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Location
    Istanbul-Turkey
    Posts
    9
    I am still waiting your examples.Did you forget sending?

  6. #6
    Member
    Join Date
    Sep 2001
    Location
    Australia
    Posts
    36
    I am not sure if these examples will help with your problem though....

    Start with the sessions code.....

    Dim Sessions As Object
    Dim System As Object
    Set System = CreateObject("EXTRA.System")
    'Gets the system object
    Dim Sess0 As Object, Toolbar As Object, Qpad As Object
    Set Sess0 = System.ActiveSession


    'Checking tool bars, and finding the index of mine in the collection

    dim vtb as integer, tb3270 as integer, imgtb as integer
    set Toolbar = Sess0.Toolbars
    For i = 0 To Toolbar.Count
    If Toolbar.Item(i).Name = "3270" Then
    tb3270 = i
    End If
    If Toolbar.Item(i).Name = "IMGTB" Then
    imgtb = i
    End If
    If Toolbar.Item(i).visible = true Then
    vtb = vtb + 1
    End If
    Next

    'I find which mainframe screen the user is looking at
    'Get the ID of the current screen
    Screen$ = Sess0.Screen.GetString(3, 75, 6)

    'and bring up my toolbar if we are on particular screens

    If Screen = "MRM044" or Screen = "MRM005" or Screen = "MRM284" or Screen = "MRM257" Then
    Toolbar.Item(tb3270).visible = false
    Toolbar.Item(imgtb).visible = true


    'Here I call an App (VBA because I dont have pure VB yet), then I
    'wait for it to return.... This app gets a user password and maps a drive...

    PathAp = """" & "C:\Program Files\E!PC\Macros\PW1.mdb" & """"
    IApp = PathAc & " " & PathAp
    'Execute the App
    Rc = Shell(IApp)
    On Error Resume Next
    'Check for the App return code file
    FinFile = "C:\Program Files\E!PC\Macros\finish.txt"
    'Wait until the App has finished, either success or fail.
    Do While FinFlag = 0
    FinTest = GetAttr(FinFile)
    If Err<>0 then
    On Error Resume Next
    ' Wait half a second, then check again
    Sess0.Screen.WaitHostQuiet(500)
    Else
    FinFlag = 1
    End If
    Loop
    'App has finished, wait 1 second for the I drive to refresh and see if it was successful
    Sess0.Screen.WaitHostQuiet(1000)
    On Error GoTo IFail
    'If the I drive is still not mapped, then we fail.
    filetime = GetAttr(ITest)
    End If


    This is some of the code from my Extra Macro, as you can see I dont know if much of it will applyto your situation

  7. #7

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Location
    Istanbul-Turkey
    Posts
    9
    It helps me.Thank you very much again..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width