Consulting

Results 1 to 5 of 5

Thread: Can this be streamplined to execute faster?

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Can this be streamplined to execute faster?

    I have passed this along to a couple of you but Zack suggested I post this and see what response I get.

    This code reads against our mainframe and what it looks like it does is read a screen for data. There are 4 distinct loops. I am sure that the mainframe pulls the data from tables but cannot figure what tables they are getting them from. Worst case scenario, can this code be made to run cleaner and faster? Presently it takes over 5 hours to "scrape" the data. Does it have something to do as well with the server speed and traffic? Thanks in advance for any help.

  2. #2
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    Austen, as we discussed and after further reviews of the code, it is hard to say what can be done faster, since the code is pretty effective as is. It would seem the issue of time is more related to the host session response from the mainframe. Since none of us can actually execute the code to test anything, it would be fairly difficult to try and speed it up.

    Nothing I saw in the code indicated a reason for slow execution, so it seems the mainframe response is the main issue.
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




  3. #3
    VBAX Master XLGibbs's Avatar
    Joined
    Jan 2006
    Location
    state of confusion, but vacation in denial
    Posts
    1,315
    Location
    PS, since the mainframe has tables of data, it would make more sense to get your hands on the actual tables then trying to screen scrape. Obviously this fellow who wrote this was trying to do it the hard way, even though it might have seemed the more direct route in his mind.
    If you have posted the same question at multiple forums, please read this IMPORTANT INFO.

    Please use the thread tools to mark your thread Solved


    Please review the Knowledge Base
    for samples and solutions , or to submit your own!




  4. #4
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    I only went thru about 10% of the code, but here is a partial list of subs that contain loops that use a 1/2 second delay in EACH ITERATION of the loop.



    HostSettleTime = 500 milisecondsEnd Sub

    Sub Send_ENTER_Key()
    CurSession.Screen.WaitHostQuiet(HostSettleTime)
    End Sub

    Sub Send_PF3_Key()
    CurSession.Screen.WaitHostQuiet(HostSettleTime)
    End Sub

    Sub INITIALIZE()
    msgbox "initialize"
    End Sub

    Sub DEINITIALIZE()
    End Sub

    Sub LOGON()
    Do Until Mid(CurScreenTXT1, 1, Len("EMSP00")) = "EMSP00"
    CurSession.Screen.Sendkeys("n003035<Tab>CMProd0")
    Do Until Mid(CurScreenTXT1, 1, Len("EMSP01")) = "EMSP01"
    Do Until Mid(CurScreenTXT1, 1, Len("IKJ56455I")) = "IKJ56455I"
    Do Until Mid(CurScreenTXT1, 1, Len("USER MASTER APPLICATION MENU")) = "USER MASTER APPLICATION MENU" 'TSO MAIN SCREEN MENU
    End Sub

    Sub LOGOFF()
    Do Until Mid(CurScreenTXT1, 1, Len("READY")) = "READY"
    Do Until Mid(CurScreenTXT1, 1, Len("EMSP01")) = "EMSP01"
    End Sub

    Sub DELETE_DATASET()
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Confirm Dataset Delete")) = "File-AID Confirm Dataset Delete" 'File-AID Allocate, Delete Menu
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Dataset Utility")) = "File-AID Dataset Utility"
    End Sub

    Sub ALLOCATE_DATASET()
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Dataset Utility DUPLICATE DATASET NAME")) = "File-AID Dataset Utility DUPLICATE DATASET NAME" 'File-AID Allocate, Delete Menu
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Allocate New Seq/PDS Dataset")) = "File-AID Allocate New Seq/PDS Dataset" 'File-AID Allocate, Delete Menu
    End Sub

    Sub DELETE_COPYBOOK_DATASETS()
    Do Until Mid(CurScreenTXT1, 1, Len("USER MASTER APPLICATION MENU")) = "USER MASTER APPLICATION MENU" 'TSO MAIN MENU
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Primary Option Menu")) = "File-AID Primary Option Menu" 'File-AID MAIN MENU
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Dataset Utility")) = "File-AID Dataset Utility" Do Until Mid(CurScreenTXT1, 1, Len("File-AID Primary Option Menu")) = "File-AID Primary Option Menu" 'File-AID MAIN MENU
    Do Until Mid(CurScreenTXT1, 1, Len("USER MASTER APPLICATION MENU")) = "USER MASTER APPLICATION MENU" 'TSO MAIN SCREEN MENU
    End Sub

    Sub ALLOCATE_COPYBOOK_DATASETS()
    Do Until Mid(CurScreenTXT1, 1, Len("USER MASTER APPLICATION MENU")) = "USER MASTER APPLICATION MENU" 'TSO MAIN SCREEN MENU
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Primary Option Menu")) = "File-AID Primary Option Menu" 'File-AID MAIN MENU
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Dataset Utility")) = "File-AID Dataset Utility"
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Primary Option Menu")) = "File-AID Primary Option Menu" 'File-AID MAIN MENU
    Do Until Mid(CurScreenTXT1, 1, Len("USER MASTER APPLICATION MENU")) = "USER MASTER APPLICATION MENU" 'TSO MAIN SCREEN MENU
    End Sub

    Sub UPLOAD_A_DATASET()
    Do Until Mid(CurScreenTXT1, 1, Len("USER MASTER APPLICATION MENU")) = "USER MASTER APPLICATION MENU" 'TSO MAIN MENU
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Primary Option Menu")) = "File-AID Primary Option Menu" 'File-AID MAIN MENU
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Dataset Utility")) = "File-AID Dataset Utility" 'File-AID Allocate, Delete Menu
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Primary Option Menu")) = "File-AID Primary Option Menu" 'File-AID MAIN MENU
    CurScreenTXT1 = TxtStrEMPTY
    Do Until Mid(CurScreenTXT1, 1, Len("USER MASTER APPLICATION MENU")) = "USER MASTER APPLICATION MENU" 'TSO MAIN SCREEN MENU
    Do Until Mid(CurScreenTXT1, 1, Len("File-AID Primary Option Menu")) = "File-AID Primary Option Menu" 'File-AID MAIN MENU
    End Sub


    Sorry 'bout the staggering.

  5. #5
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Thanks.

Posting Permissions

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