MVS Tools & Tricks
Total Page:16
File Type:pdf, Size:1020Kb
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 REXX, 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. macro 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 programming language, 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.