Skip to main content

Automate Your TSO Logons With Vista TN3270 Application Macros and a Windows Batch (.bat) File

In this tutorial, we look at all the steps that are involved in the process of automating TSO logons, using the Vista TN3270 application and a Windows Batch (.bat) file.

Components Involved

  1. Vista TN3270 Terminal session application
  2. Vista TN3270 Terminal session application session file (.ses file)
  3. Vista TN3270 Terminal session application MACRO file (.mac file)

Step by Step Instructions

Step 1: Create a new session file for your Vista TN3270 Terminal session Application

As the very first step, we will create a new session file for our Vista TN3270 Terminal session application.
Follow the steps in this “how-to” video and create a new session file for your Vista TN3270 Terminal session application.

Step 2: Create a Vista TN3270 Terminal session application macro to automatically login to a mainframe TSO session

The next step is to create a Vista TN3270 Terminal session application macro that will help automatically login to a mainframe TSO session.

Follow the steps in this “how-to” video and create the MACRO file that will help automatically login to a mainframe TSO session.

Step 3: Building the Windows batch script

It’s now the time to build the Windows batch script that will drive the process of automated TSO logons. But, before doing that, let’s go ahead and locate the session and MACRO files which we had created in the previous two steps.

Usually, by default, the session file gets created under the path “C:Program Files (x86)TomBrennanSoftwareVistaTN3270” but this might very well be different on your system (see Figure 1).

fig1.png
Figure 1

Similarly, the MACRO file gets created under the path “C:Program Files (x86)TomBrennanSoftwareVistaTN3270defaultsmacros” by default and this might again be different on your system (see Figure 2).

fig2.png
Figure 2

Next, I copy the MACRO file from its default path “C:Program Files (x86)TomBrennanSoftwareVistaTN3270defaultsmacros” to the path “C:Program Files (x86)TomBrennanSoftwareVistaTN3270”, where the session file resides (see Figure 3). This is just for convenience; both the session and MACRO files residing under the same path is a convenient option.

fig3.png
Figure 3

Now, we can start building our batch script. Our batch script consists of simple two lines of code:
CD C:Program Files (x86)TomBrennanSoftwareVistaTN3270
vistaTN3270.exe Our-First-Session-File.ses /m Our-First-TN3270-MACRO-Sample.mac

NOTE: The ‘vistaTN3270.exe’ file should exist under the path that you choose to CD to. And, choose to place the session and MACRO files under the same path (see Figure 4).

fig4.png
Figure 4

Place the two lines of code into a .txt file (see Figure 5). Save the file as a .bat file and place the file on our Desktop—or, for that matter, anywhere on the system that you are working on (see Figure 6).

fig5.png
Figure 5

fig6.png
Figure 6

Step 4: Time to execute the batch script

The next step is to execute the batch script. Executing the batch script allows for an automated TSO logon. Follow the steps in this video to execute the batch script and watch the automated TSO logon process in action.

So, we’ve seen how we can entirely automate TSO logons using the Vista TN3270 application and a simple Windows Batch (.bat) file.

Learn More About the VISTA TN3270 Macro Language

If you look at the content of the MACRO file, you will find that the MACRO file is essentially made up of several Vista TN3270 macro statements, and these macro statements are a part of the Vista TN3270 macro language that is used to design Vista TN3270 macros. Our macro file consists of a very limited number of Vista TN3270 macro statements; therefore, if you want to learn more about the Vista TN3270 macro language, the best option is to go through the Vista TN3270 documentation.

On the Windows Start Menu, search for the ‘Vista TN3270’ folder. Expand the folder and click on the ‘Vista TN3270 Help’ icon/option (see Figure 7).

fig7.png
Figure 7

That should open the whole of Vista TN3270 documentation (see Figure 8).

fig8.png
Figure 8

All information in this article is provided to you “as is” and represents the views of the authors. TechChannel cannot guarantee or imply absolute reliability, serviceability or function of the information herein.