PASSPORT Knowledge Base
Macros

Date Published: April 9, 2010

Title

Logon Macro Using WaitForCursorPos and WaitForString Functions

Macro Type

.ZMC

Description

This macro will logon to TSO, wait for specific text to appear on the screen, then access the ISPF main menu using the WaitForCursorPos and WaitForString functions. Each of the SendHostKeys, WaitForCursorPos and WaitForString statements must be modified for use with your host. Also, USERID and USERPASSWORD must be replaced with a valid username and password.

Sample Code


Sub ZMain()
Dim Text
SendHostKeys ("tso<ENTER>")
WaitForCursorPos 2,1,10
SendHostKeys ("USERID<ENTER>")
WaitForString 8,5,"Password",10
SendHostKeys ("USERPASSWORD<ENTER>")
WaitForString 5,2,"SCREENTEXT",10
SendHostKeys ("<ENTER>")
End Sub

More Information


a