1

At work I must extract data from an AS400 screen using IBM i Access Client Solutions.

I used to have code that I could use with PComm; however, they recently replaced the software in my company (without asking) and that is causing delays of up to several days.

Here is the old code I had:

Option Explicit

Sub JDE()
' Uses Microsoft forms 2.0 object libraries as references
' You must have Pcomm from IBM installed for this to work:
' https://www.ibm.com/us-en/marketplace/personal-communications
    Dim autECLSession, autECLOIA, autECLPS, autECLConnList As Object
    Dim JDE, Enter, Load, F1, F2, F3, F4, F5, ShF4, PageDown, PageUp, Clear As String

    Set autECLSession = CreateObject("Pcomm.autECLSession")
    Set autECLOIA = CreateObject("Pcomm.autECLOIA")
    Set autECLPS = CreateObject("Pcomm.autECLPS")
    Set autECLConnList = CreateObject("PCOMM.autECLConnList")
    autECLSession.SetConnectionByName "A"

    Set JDE = autECLSession.autECLPS
    Set Load = autECLSession.autECLOIA

    Enter = "[enter]"
    F1 = "[pf1]"
    F2 = "[pf2]"
    F3 = "[pf3]"
    F4 = "[pf4]"
    F5 = "[pf5]"
    ShF4 = "[pf15]"
    PageDown = "[Roll up]"
    PageUp = "[Roll down]"
    Clear = "[erase eof]"

    ' Extracting text
    Selection= JDE.GetText (10, 64, 10(spaces required))

    ' Navigating JDE
    Load.waitforappavailable
    Load.WaitForInputReady
    JDE.SendKeys F1
    JDE.SendKeys F2
    JDE.SendKeys F3
    JDE.SendKeys F4
    JDE.SendKeys ShF4
    JDE.SendKeys Clear
    JDE.SendKeys PageDown
    JDE.SendKeys PageUp

End Sub

The example above helps me navigate the screens by sending several keystrokes and to extract some text to memory.

vicsar
  • 301
  • 5
  • 16
  • Deleting a question that was almost closed, and reposting the same thing as a new question is almost guaranteed to get a ton of close and down votes. In fact if you aren't careful, you could get locked out. I would edit this into a real question and separate answer quickly. If I were you. – jmarkmurphy Dec 21 '18 at 16:39
  • @jmarkmurphy, you are confused. IBM i Access Client Solutions is not the same as PComm. This is a real task I need to accomplish. The code above worked for and old software we had. I separated both questions as they are for different platforms. Anyways, seeing how much controversy and confusion that question seems to be causing I have now deleted it. In the other comment you asked " Do you need Set Load = autECLSession.autECLOIA in the code twice? what is the purpose of that? –" Well... no that was a mistake. I just removed that line. – vicsar Dec 21 '18 at 16:54
  • You are correct, the question says iAccess Solutions, and I read PCOMM. – jmarkmurphy Dec 21 '18 at 17:09

0 Answers0