Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested example z/OS TSO logon script #150

Open
pjfarleyiii opened this issue Oct 6, 2024 · 1 comment
Open

Suggested example z/OS TSO logon script #150

pjfarleyiii opened this issue Oct 6, 2024 · 1 comment

Comments

@pjfarleyiii
Copy link

pjfarleyiii commented Oct 6, 2024

I am contributing a commented generic z/OS TSO example script here because my git-fu is almost non-existent, so I have no chance at all of completing a proper git update. I ask the author to please put this into the product.

from tnz.ati import ati

# 1.  Set up for TN3270 conection
ati.set("TRACE", "ALL") # Turn tracing on
ati.set("LOGDEST", "tso-example.log") # Log file name

ati.set("ONERROR", "1")
ati.set("DISPLAY", "HOST") # HOST screens will be logged
ati.set("SESSION_HOST", "999.999.999.999") # Real IP addr or host name here
ati.set("SESSION_PORT", "23") # or alternate port per your installation
# 2.  This is where the conection is made
ati.set("SESSION", "A")

# 3.  Wait for VTAM logon screen then logon to your system
ati.wait(lambda: ati.scrhas("Welcome To TCP/IP Network"))
ati.send("logon applid=MyLPAR,logmode=D4C32XX3[enter]") # Your TSO APPLID here

# 4.  Wait for userid message and enter userid
ati.wait(lambda: ati.scrhas("IKJ56700A"))
ati.send("tsouser[enter]")

# 5.  Wait for password screen and enter password
ati.wait(lambda: ati.scrhas("Password  ===>"))
ati.send("mypasswd[enter]")

# 6.  If your TSO SIGNON.EXEC asks questions during logon, answer them here
ati.wait(lambda: ati.scrhas("DO YOU WANT TO"))
ati.send("[enter]")

# 7.  Wait for primary ISPF menu then enter 3.4 for DS List utility
ati.wait(lambda: ati.scrhas("Primary Option Menu"))
ati.send("3.4[enter]")

# 8.  Wait for DS List menu to come up, then ask for SYS1.PROCLIB
ati.wait(lambda: ati.scrhas("Data Set List Utility"))
ati.send("[newline][newline][newline]sys1.proclib[enter]")

# 9.  Wait for dataset to be found, then ask to browse it
ati.wait(lambda: ati.scrhas("Data Sets Matching"))
ati.send("[newline]b[enter]")

# 10. Wait for BROWSE member list to come up, then locate member RDR
ati.wait(lambda: ati.scrhas("BROWSE"))
ati.send("L RDR[enter]")
ati.wait(1) # Wait a little more because PROCLIB can have many members

# 11. Wait for locate to complete then select the member for browse
ati.wait(lambda: ati.scrhas("BROWSE"))
ati.send("[newline][newline]S[enter]")

# 12. Wait for initial BROWSE screen to come up, then quit with PF3
ati.wait(lambda: ati.scrhas("** Top of Data **"))
ati.send("[pf3]")

# 13. Continue quitting with PF3 up the menu chain to the primary menu
ati.wait(lambda: ati.scrhas("BROWSE"))
ati.send("[pf3]")

ati.wait(lambda: ati.scrhas("Data Sets Matching"))
ati.send("[pf3]")

ati.wait(lambda: ati.scrhas("Data Set List Utility"))
ati.send("[pf3]")

# 14 Now exit ISPF
ati.wait(lambda: ati.scrhas("Primary Option Menu"))
ati.send("x[enter]")

# 15. Logoff the system
ati.wait(lambda: ati.scrhas("READY"))
ati.send("logoff[enter]")

# 16. Wait for "LOGGED OFF" message then disconnect
ati.wait(lambda: ati.scrhas("IKJ56470I"))
ati.drop("SESSION")
@najohnsn
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants