MVS Tools & Tricks BY SAM GOLOB TSO Basics: Revisited

ome of us go back to the days when PSCB bit settings control such properties SYS1.UADS, or from the settings in the S system support consisted of punching as OPER authority (the ability to issue TSO segment of the security system’s cards and running batch jobs. Those of us operator console commands from TSO), (RACF or equivalent) profile for that who remember appreciate how important it JCL authority (the ability to submit batch userid. However, once the TSO session is to have the ability to work interactively jobs), ACCOUNT authority (the ability to has been established and is running, the from terminals using IBM’s Time Sharing create and alter other TSO userids), and PSCB may be altered by using an autho- Option (TSO). Here I will reemphasize rized command. The truth is, the PSCB some aspects of TSO that may not be settings are the ones that are used by TSO, foremost in our minds. If you combine the not the RACF or UADS settings. TSO You cannot picture TSO as merely a way uses the PSCB as the reference point for to submit jobs using a terminal. Rather, a large collection of all subsequent “TSO authority” checking, TSO session actually has the same full such specialized TSO once the session has started, and does not access to the MVS operating system as a refer back to RACF or UADS later for the batch job or a started task. Let me elaborate command programs TSO-specific things. TSO interacts with a bit. Years ago, I used to work on a with the programming RACF later, in the same way as a batch DOS/VSE system part time. In order to do job, for doing “RACF-specific things.” anything, we had to punch cards and run features of CLISTs For example, a TSO session would interact batch jobs on that system. Then, we got an and , the with RACF to verify whether it should early version of Interactive Control and have access to a dataset. Computing Facility (ICCF), which was TSO environment There are two free tools available in the IBM’s DOS/VSE terminal interface at that becomes a super CBT MVS Utilities Tape collection on File time. ICCF was a vast improvement over 300 that give you the ability to control the punching cards and reading them. However, mega-powerhouse to PSCB settings. These are called LPSCB to my knowledge, ICCF was only a better control and fix (“look at the PSCB”) and CPSCB (“change way of storing 80-byte card images, and in the PSCB”). Of course, CPSCB must run order to do any real work in the operating computer processing as an “authorized command.” However, system, you still had to submit a separate on the MVS system. LPSCB can be run by anyone, because all batch job. True interactivity of the terminal LPSCB does is to read and display the con- interface, with the innards of the operating tents of the PSCB control block. The IBM system, was not yet available. that describes the contents of the Not so TSO! Each TSO session runs in MOUNT authority (the ability to autho- PSCB is called IKJPSCB, and on an OS/390 an MVS address space and has full access rize a tape mount from the TSO session). 2.10 system IKJPSCB can be found in to everything in the operating system the These controls are TSO’s way of indicat- SYS1.MACLIB. It is worth your while to same way a batch job has. The only ing whether one userid is more “powerful” take 10 minutes to look at the IKJPSCB restriction is imposed by the security sys- than another. My point is that a “fully macro, and to see the kind of things in TSO tem (RACF, or whatever security package empowered” TSO userid can go anywhere that the PSCB controls. you have) and by TSO itself. Let me in the system; TSO does not merely store explain TSO’s main security mechanism. card images. WHAT CLISTS AND REXX Within TSO, a control block, called the The PSCB control block is created for EXECS DO Protected Step Control Block (PSCB) is each TSO session at logon time. The ini- established for each user. Within the tial bit settings in a particular TSO user’s I mentioned before that TSO sessions PSCB are bit settings to establish the PSCB come from one of two places: can interact with the MVS operating sys- “authority level” of that TSO user. These either they are derived from settings in tem in the same way as a batch job does.

TECHNICAL SUPPORT • NOVEMBER 2001 WWW.NASPA.COM Potentially, this means that using TSO program execution, the CLIST would issue region available to the TSO session and alone you should not have to run batch FREE TSO commands against the allo- executes the TSO-command load module. jobs. Avoiding batch jobs is not always cated files to make them available for others The feature that distinguishes a TSO practical, but let me explain how it is pos- to use. command program from any other exe- sible to do the task of a batch job using Actually, besides just being vehicles to cutable load module is that it expects only TSO. execute programs and pre-allocate the files, Register 1 to point to a TSO control block What are the parts of a batch job as CLISTs have access to an interactive pro- (created by the control program of the TSO defined by its JCL? First, there is the JOB gramming language. Using the CLIST session) called the Command Processor card. The TSO equivalent of the JOB card , you can execute Parameter List (CPPL). The CPPL contains is the session itself. All the activities of programs conditionally under the CLIST’s four address pointers. The first one points that TSO session are included under its control, and you can insert PARM data into to the buffer containing the command itself auspices, as though they were running as the programs conditionally. The CLIST (and possible parameters) — called the part of one job (the TSO session). Next language, besides being suited to executing Command Buffer — and the other three comes the EXEC card, which denotes the batch-type programs, is also tailored for point to the three TSO control blocks — the execution of a particular program and executing TSO-specific programs, called UPT, the PSCB, and the ECT. The CPPL is defines the “JOB STEP”. Under TSO, the TSO Commands. All in all, CLIST files, mapped by the macro IKJCPPL in user issues a “CALL” TSO command to executing under TSO, allow for much more SYS1.MACLIB. execute a batch program, or the user issues flexibility and conditional execution than It is important to note that a TSO com- any other TSO command, which is a load batch programs with their COND state- mand program can do anything that a batch module that was specifically designed to ments in the EXEC cards. program can, and is more suited to running run under TSO. The execution of such applications that interact with the terminal. programs or commands under TSO REXX: A FULL-BLOWN A user can write TSO commands to do defines the equivalent of a job step. PROGRAMMING LANGUAGE highly sophisticated specialized tasks, Finally, just as files are defined to a batch such as zapping disk storage interactively, job through the use of DD cards in the However, it does not stop there. As good changing the attributes of load modules, JCL, files are made known to a TSO session as the CLIST language is in providing pro- and browsing the contents of datasets in through the use of ALLOC and ATTRIB gramming flexibility to complicated chains full screen mode. If you combine the large TSO commands, which dynamically allo- of TSO command executions, its successor, collection of such specialized TSO com- cate any files needed by the program to be the REXX language, is far better. REXX is mand programs with the programming run under the TSO session. When these a full-blown programming language that features of CLISTs and REXX, the TSO files are no longer needed to do the task can access and manipulate MVS storage environment becomes a super mega-power- (job step), the FREE command is executed and follow control block chains, as well as house to control and fix computer processing against them to dynamically deallocate conditionally call programs to execute on the MVS system. them from the TSO session. against files. TSO in MVS, equipped with It is hard to enter all the ALLOC com- the CLIST and REXX languages as well, TSO-IN-BATCH mands and CALL commands necessary provides all kinds of system processing and every time you want to run a program system manipulation capabilities. I need to mention why you might want under TSO. It would be like having to Now you can see that TSO under MVS is to run a batch job instead of doing all retype all the JCL by hand every time you more than just a system to store a stack of your work under TSO. The problem with wanted to run a program in batch. Under cards for job submission. running a program under TSO is that it TSO, IBM made it possible to collect the usually ties up your terminal while it is TSO commands and data necessary to run TSO COMMANDS executing. For this reason, you would a task the same way you keep the JCL to rather run a batch job, which quietly runs run a job in a file, and submit it. This “bundle TSO commands are programs designed in its own address space using general of TSO commands” to perform a certain specifically to run in a TSO environment. system resources, but keeps your terminal purpose is called a CLIST, or Command TSO commands are load modules that are free to do other work. List. You can either execute the CLIST as a executed by typing their actual name during Under certain circumstances, you can get single sequential file, or as a member of a a “raw TSO session.” Therefore, if a TSO the best of both worlds by running TSO as a partitioned dataset, using the exec TSO session is in READY mode, you execute a batch job using a process called TSO-in- command. A typical CLIST that simulates TSO command by just typing its name and Batch. TSO-in-Batch is very suitable for a batch job would contain ALLOC com- pressing ENTER. running long-executing TSO commands mands to allocate files as well as a CALL IBM’s ISPF developers have added a that do not require a lot of user interaction. command to execute a program that runs facility to execute TSO commands from an TSO-in-Batch would also come in handy if against the allocated files. The program ISPF command line during an ISPF session you are running a long succession of TSO would then run in the region of the TSO running under TSO. Under ISPF, you type commands one after the other, even a few address space. Output would be directed to the word “TSO” on the command line and hundred of them. the files previously defined by the ALLOC then type the name of the TSO command. You run TSO-in-Batch by setting up a commands in the CLIST. Finally, after The TSO command program then uses the pseudo-TSO environment in a batch

©2001 Technical Enterprises, Inc. Reproduction of this document without permission is prohibited. TECHNICAL SUPPORT • NOVEMBER 2001 region using JCL. The EXEC card exe- FINDING OUT MORE it looks like it is coming from a very basic cutes the program IKJEFT01, which is the viewpoint. Experienced MVS practitioners TSO control program. DD cards that are You can begin to exploit the vast capa- will see a lot of depth that is implicit in the required are SYSTSPRT, to print (what bilities of TSO by first referring to the subjects I have mentioned. TSO is a vast would be) the terminal output, and IBM CLIST and REXX books that are in world. Use it well! SYSTSIN, to enter the TSO commands the TSO collection for your release of and their parms, which you want to run in MVS, OS/390, or z/OS. Second, you can the batch job. Additionally, you could look at the CBT MVS Utilities Tape col- specify the TSO commands to be run in lection. Files 300, 134, 182, 183, and 296 the PARM field of the EXEC card when of the CBT Tape collection are especially you are executing PGM=IKJEFT01. suitable for beginners, although advanced When running a TSO-in-Batch job, you practitioners will gain from those files as may need to specify other DD names, such well. Do not ignore the TSO/E Users as SYSPROC, to specify a CLIST library, Guide, which tells you about basic IBM- or SYSEXEC, to specify a pds containing supplied TSO commands that supply nec- REXX execs. Additionally, if the programs essary services. TSO/E Customization NaSPA member Sam Golob is a senior systems that you are executing require files, you can contains valuable knowledge about how programmer. He also participates in library allocate them using suitable DD cards in the your TSO environment is set up. And tours and book signings with his wife, author IKJEFT01 step. To execute TSO commands finally, if you want to learn how to write Courtney Taylor. Sam can be contacted at out of a load library that is not in the TSO commands yourself, refer to the [email protected]. The Online CBT Tape Linklist or LPA List, you might include a TSO/E Programming Guide. Web site can be accessed from the “Members STEPLIB DD card in the JCL to point to the I hope that you have gained some knowl- Only” section of the NaSPA Web site at load library needed. edge from this month’s column, even though www.naspa.com.

TECHNICAL SUPPORT • NOVEMBER 2001 WWW.NASPA.COM