Mastering essential TSO commands is fundamental to effective mainframe work. These commands provide the core functionality you need for daily operations: managing datasets, submitting jobs, communicating, and managing your session. This tutorial covers the most important TSO commands that every mainframe user should know: ALLOCATE, FREE, LISTCAT, DELETE, SEND, RECEIVE, SUBMIT, FIND, PROFILE, LOGOFF, and HELP.
These commands form the foundation of TSO usage. While ISPF provides menu-driven interfaces for many operations, understanding these TSO commands gives you flexibility, enables scripting and automation, and helps you work more efficiently. Many of these commands are also available within ISPF, but knowing the TSO command syntax allows you to use them in scripts, CLISTs, and REXX execs.
The ALLOCATE command allocates a dataset to a DD (Data Definition) name, making it available for use by programs or TSO commands. Allocation is essential for making datasets accessible to applications and is one of the most frequently used TSO commands.
The basic syntax for ALLOCATE is:
1ALLOCATE FILE(DDNAME) DATASET('DSNAME')
Where:
ALLOCATE supports many options that control how the dataset is allocated:
Here are examples of ALLOCATE commands:
1ALLOCATE FILE(INPUT) DATASET('USERID.SOURCE.COBOL') SHR
This allocates a dataset for shared read access.
1ALLOCATE FILE(OUTPUT) DATASET('USERID.OUTPUT.DATA') OLD
This allocates a dataset for exclusive write access.
The FREE command releases an allocation, freeing the DD name and making it available for other uses. After freeing an allocation, the dataset is no longer associated with that DD name.
The basic syntax for FREE is:
1FREE FILE(DDNAME)
Or to free all allocations:
1FREE ALL
Use FREE when:
While allocations are automatically freed when you log off, it's good practice to explicitly free allocations when you're done with them, especially in scripts or long-running sessions.
The LISTCAT command lists catalog entries, showing datasets and their attributes. LISTCAT is essential for finding datasets, checking their existence, and viewing their attributes.
To list all your datasets:
1LISTCAT
To list a specific dataset:
1LISTCAT ENT('USERID.SOURCE.COBOL')
LISTCAT supports various options:
LISTCAT displays information including:
The DELETE command deletes datasets or members from the system. DELETE permanently removes data, so use it carefully.
To delete a dataset:
1DELETE 'USERID.OLD.DATA'
To delete a member from a PDS:
1DELETE 'USERID.SOURCE.COBOL(MEMBER1)'
DELETE supports options like:
Important considerations when using DELETE:
The SEND command sends messages to other TSO users or your own terminal. SEND is useful for communication and notifications.
To send a message to another user:
1SEND 'message text' USER(userid)
To send a message to your own terminal:
1SEND 'message text'
SEND is useful for:
The RECEIVE command receives messages sent to you via SEND. RECEIVE displays messages that have been sent to your userid.
To receive and display messages:
1RECEIVE
RECEIVE may support options like:
The SUBMIT command submits batch jobs for execution. SUBMIT is essential for running programs, compiling code, and performing batch operations.
To submit a JCL job:
1SUBMIT 'USERID.JCL.JOB(MEMBER1)'
Or for a sequential dataset:
1SUBMIT 'USERID.JCL.JOB'
SUBMIT typically returns:
After submitting a job:
The FIND command searches for text within datasets. FIND is useful for locating specific information in files.
To find text in a dataset:
1FIND 'searchtext' 'USERID.SOURCE.COBOL'
FIND may support options like:
The PROFILE command manages your TSO profile settings. PROFILE allows you to view and modify your personal TSO configuration.
To view your profile:
1PROFILE LIST
To set a profile option:
1PROFILE PREFIX(USERID.DATA)
PROFILE can set various options including:
The LOGOFF command ends your TSO session, properly closing all allocations, releasing resources, and terminating your connection.
To log off:
1LOGOFF
LOGOFF:
Always use LOGOFF to end your session rather than just closing your terminal emulator. LOGOFF ensures proper cleanup and resource release.
The HELP command displays help information for TSO commands. HELP is invaluable for learning commands and checking syntax.
To get help for a command:
1HELP commandname
For example:
1HELP ALLOCATE
HELP typically provides:
Following best practices helps you use these commands effectively:
Think of TSO commands like tools in a toolbox:
So TSO commands are like special tools that help you work with the computer, and each tool does a specific job!
Complete these exercises to reinforce your understanding of essential TSO commands:
Practice using each essential command: ALLOCATE a dataset, use LISTCAT to verify it, FREE the allocation, use HELP to learn about each command, and practice SUBMIT with a test job. Document your experiences and any issues you encounter.
Create a personal reference document for each essential command. Include syntax, common options, examples, and when to use each command. This reference will help you remember commands and use them effectively.
Practice common workflows using these commands: allocate a dataset, work with it, free it, list your datasets, and submit a job. Create a workflow that uses multiple commands together and practice it until it becomes natural.
Practice safe command usage: verify dataset names before operations, test commands on non-critical data first, use HELP to check syntax, and always use LOGOFF properly. Develop habits that prevent mistakes and data loss.
Compare TSO commands with their ISPF equivalents. For example, compare TSO ALLOCATE with ISPF dataset allocation, or TSO LISTCAT with ISPF dataset list utilities. Understand when to use TSO commands versus ISPF menus.
1. Which TSO command allocates a dataset to a DD name?
2. What command releases an allocation?
3. Which command lists catalog entries?
4. What command ends your TSO session?
5. Which command submits a batch job?