How to use terminal activities for mainframe automation

We are planning to automate a mainframe application. Currently the application is loaded using Putty(seems to be telnet) with its hostname and port number. How to use terminal activities on this. please guide me with some samples.