Basic TSO Commands

Commonly used TSO commands:

This mainframe tutorial is about TSO commands.

1. Create a new dataset modeled after an existing one

ALLOC DSN(ABCXYZ.SOURCE.NEW) NEW LIKE(ABCXYZ.SOURCE)

This command will allocate a new dataset . ABCXYZ.SOURCE.NEW having the same DCB as .ABCXYZ.SOURCE

2. Concatenate dataset to a program for use as input or output

ALLOCATE with the SHR or OLD keyword and the DDN keyword

ALLOC DDN(SYSPROC) SHR REUSE DSN(ABCXYZ.REXX)

This command will concatenate the dataset .ABCXYZ.REXX to the ddname SYSPROC in your ID job.

You can ALLOC using the SHR or OLD keyword.

3. Remove the concatenation between a file and a program.

FREEDDN(SYSPROC)

4. Copy a file

REPRO INDATASET(‘USERID.ABCXYZ.CLIST’)

              OUTDATASET(‘USERID.ABCXYZ.REXX’)

5. Display the attributes of a dataset

LISTDS ABCXYZ.REXX

(This will list the attributes of the dataset USERID.ABCXYZ.REXX)

6. Display the attributes of a PDS and list the member names

LISTDS ABCXYZ.REXX MEMBERS

7. Display the dataset names and ddnames currently in use in your TSO session.

LISTALC STATUS HISTORY SYSNAMES

8. Display catalog information about a specific dataset.

LISTCAT ENTRY(ABCXYZ.REXX) ALL

9. List the names of datasets whose names begin with a specific high-level qualifier.

LISTCAT LEVEL(HLQ)

For example, LISTCAT LEVEL(USERID)

10. Deletea dataset

DELETE   ABCXYZ.REXX

Which is the same as saying   DELETE ‘USERID.ABCXYZ.REXX’

11. Deletea PDS member (not the whole PDS)

DELETE ABCXYZ.REXX(REXXTST)

12. Renamea dataset or library

RENAME ABCXYZ.CLIST ABCXYZ.REXX

13. Authorizeaccess to your files with RACF.

PERMIT ‘YOUR USERID’ ID(USERID TO AUTHORIZE) ACCESS(READ)

                                                     or              ACCESS(UPDATE)

14. Send a messageto a TSO user. In this cmd, the message is cancelled if the user is not logged on.

SEND USER(USERID) ‘message’

If you give * in place of USERID, you’ll get the message.

15. Waituntil the user is able to receive the message.

SEND USER(USERID) ‘message’ WAIT

16. Send a message to another user, so that if the user is not logged on currently, the message will be delivered when the user logs on.

SEND USER(USERID) ‘message’ LOGON

17. Senda dataset to another user in another node.

XMIT NODE.USERID DSN(ABCXYZ.REXX)

18. Receive a datasetor library sent by another user with XMIT

RECEIVE

19. Display messages sent to you while you were logged off

LISTBC

20. Display current job status of jobs that you have submitted

STATUS

21. Cancel a job that you have submitted

CANCEL jobname(jobnumber)

22. Cancel a job that you have submitted and discard the printed output

CANCEL jobname(job-number) PURGE