Results 1 to 23 of 23

Thread: Mainframe communication with VB6

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Location
    Manchester
    Posts
    7

    Question Mainframe communication with VB6

    I would like to establish a link to our s/390 mainframe using VB6. Currently it possesses a PCOMMS emulator, but we want more control than this gives at the moment.

    Any ideas?

    Thx
    Derrick

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    At present how do you communicate with your mainframe machine ?
    Can you telnet to it ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Location
    Manchester
    Posts
    7
    At the moment we can only ftp the mainframe. What I need is to communicate/screen-scrape the Mainframe or use something such as SENDKEYS to control the emulator.

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    What operating system is the mainframe running ?
    Can you run custom applications on the mainframe ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Location
    Manchester
    Posts
    7
    The operating system is VSE/ESA.

    We can customize any application on the mainframe, but I would not have thought it necessary to do this.

    We want, at least initially, a simple method to send commands and receive feedback from systems, including CICS, on the mainframe, or to read the VSAM files held there.

  6. #6
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well in terms of reading files, you could in theory setup an ftp account to allow access straight into certain directories on the server and pull the files from there.

    Regarding sending commans, you'd really need to telnet in to do it.
    If you can ftp in, I'd say you should be able to telnet in too...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  7. #7

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Location
    Manchester
    Posts
    7
    There are .dll files that come with PCOMMS, the mainframe emulator. I want to use these to communicate with the mainframe.

    Although software has been added for telnet it does not currently work, I still wouldnt know how to send commands and receive feedback by this method.

    Thanks
    Derrick

  8. #8
    Lively Member
    Join Date
    Apr 2002
    Location
    Manchester,UK
    Posts
    94
    There are some examples available somewhere for implementing screen scraping with the PCOMM API's, it's not that easy to use cos I tried a while ago.

    I used to have them all installed but can't find em now, look around your PCOMM installation directory for samples. You might need to read the C samples and convert it.

  9. #9
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    Originally posted by plenderj
    What operating system is the mainframe running ?
    Can you run custom applications on the mainframe ?
    It has nothing to do with interfacing between the two. What you need is third party's library. In the past (not that long ago) I've used EXTRA'S! for Windows (I think made by Attachmate Corporation) and RUMBA (can't recall manufacturer's name). These 2 are very reliable and quite easy to use. They offer both OCXs and API library.
    But the real problem with MF/VB (or whatever the front end language can be) interface isn't the tool you'll use but people that maitain MF applications. If they won't notify you of any changes on their side - your app won't work as it won't be able to find appropriate screen on the MF side.
    Last edited by McGenius; Mar 4th, 2003 at 11:43 AM.
    McGenius

  10. #10

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Location
    Manchester
    Posts
    7
    I am looking to use either EHLLAPI or HACL API's to estblish this link to VB6.

    Does this help anybody to help me?

    Regards
    Derrick

  11. #11
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    Sorry, never worked with those two, but in case you reconsider your software usage, here are the links to those that I did:
    http://www.attachmate.com
    http://www.netmanage.com/
    McGenius

  12. #12
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by McGenius
    It has nothing to do with interfacing between the two. What you need is third party's library. In the past (not that long ago) I've used EXTRA'S! for Windows (I think made by Attachmate Corporation) and RUMBA (can't recall manufacturer's name). These 2 are very reliable and quite easy to use. They offer both OCXs and API library.
    But the real problem with MF/VB (or whatever the front end language can be) interface isn't the tool you'll use but people that maitain MF applications. If they won't notify you of any changes on their side - your app won't work as it won't be able to find appropriate screen on the MF side.
    What I meant was that if they want to grab of the screen on the mainframe, they could write an app to do it.

    And if the system happened to be running a popular *nix operating system, then there may already be an easy way to do it, through the use of 3rd party applications
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  13. #13
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    Originally posted by plenderj
    What I meant was that if they want to grab of the screen on the mainframe, they could write an app to do it.

    And if the system happened to be running a popular *nix operating system, then there may already be an easy way to do it, through the use of 3rd party applications
    What you are referring to as "want to grab of the screen on the mainframe" is also called a Screen Scraping and there is no way (easy or not) without third party's interface (whatever that may be: OCX/API)
    McGenius

  14. #14
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    I know what its called.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  15. #15
    Frenzied Member MerrionComputin's Avatar
    Join Date
    Apr 2001
    Location
    Dublin, Ireland
    Posts
    1,616
    I too have used Rumba - it's not bad at all.
    ----8<---------------------------------------
    NEW - The .NET printer queue monitor component
    ----8<---------------------------------------
    Now with Examples of use

  16. #16
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Hummingbird makes a pretty good product too.
    Can't remember what its called though. Been a while since I used it.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  17. #17
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    Originally posted by plenderj
    I know what its called.
    I'm sure you do, but being a technical person you must express yourself in such manner.
    McGenius

  18. #18
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Originally posted by McGenius
    I'm sure you do, but being a technical person you must express yourself in such manner.
    Must I ?
    Thanks for pointing that out.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  19. #19
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    You are very welcome.
    McGenius

  20. #20

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Location
    Manchester
    Posts
    7
    Hummingbird supply HostExplorer, but is not what we want. Just a simple method of communication using no third party software will suffice for now.

  21. #21
    Lively Member
    Join Date
    Apr 2002
    Location
    Manchester,UK
    Posts
    94
    Derrick, what version of pcomm are you using?

    If it's 4.? I can't help but I had a play yesterday with 5.0 and it's actually quite easy.

    I created a class I called Screen

    VB Code:
    1. Option Explicit
    2.  
    3. Private mSess As AutSess
    4. Private mPS As AutPS
    5. Private mOIA As AutOIA
    6. Private mWin As AutWinMetrics
    7. Private mRows As Long
    8. Private mCols As Long
    9.  
    10. Public Sub OpenSession()
    11.     Set mSess = New AutSess
    12.     Set mPS = New AutPS
    13.     Set mOIA = New AutOIA
    14.     Set mWin = New AutWinMetrics
    15.    
    16.     mSess.SetConnectionByName "A"
    17.     mPS.SetConnectionByName "A"
    18.     mOIA.SetConnectionByName "A"
    19.     mWin.SetConnectionByName "A"
    20. End Sub
    21.  
    22. Public Function GetFields()
    23.     If mPS.CommStarted Then
    24.         GetFields = mPS.GetTextRect(1, 1, Rows, Cols)
    25.     End If
    26. End Function
    27.  
    28. Public Property Get Rows() As Long
    29.     If mPS.CommStarted Then
    30.         mRows = mPS.NumRows
    31.         Rows = mRows
    32.     Else
    33.         mRows = 0
    34.         Rows = 0
    35.     End If
    36. End Property
    37.  
    38. Public Property Get Cols() As Long
    39.     If mPS.CommStarted Then
    40.         mCols = mPS.NumCols
    41.         Cols = mCols
    42.     Else
    43.         mCols = 0
    44.         Cols = 0
    45.     End If
    46. End Property

    You have to have a session open (the first one will be "A")

    You also need to reference most of the available PCOMM API's

    I apologise if you haven't got version 5

    Mail me if you want any more code (as and when I write more of course!)

  22. #22

    Thread Starter
    New Member
    Join Date
    Mar 2003
    Location
    Manchester
    Posts
    7
    Thankyou for your time on this.

    I am using PCOMMS version 5.0.

    I have entered the code and set up a class, unfortunately when trying to set any of the objects i get the following error

    Method 'SetConnectionByName' of object 'IAutSess' failed, I have searched the net for solutions to this but it seems to be a generic problem that occurs when using COM and ADO.

    Have I set something up incorrectly in VB?

    Thx for your help
    Derrick

  23. #23
    Lively Member
    Join Date
    Apr 2002
    Location
    Manchester,UK
    Posts
    94
    This error might occur if you don't have a session open, I'll test that theory...

    ...No it wasn't that.

    I'll send you the project I started and see if it will work on your machine.

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