MVS TOOLS AND TRICKS OF THE TRADE November 1994 Sam Golob MVS Systems Programmer sbgolob@cbttape.org Sam Golob is a Senior Systems Programmer YOUR TSO SESSION - USING THE PSCB Oftentimes a simple control block exerts a very powerful influence on how a program runs. In the case of your TSO session, some of the PSCB (Protected Step Control Block) fields will have a very crucial effect on what the session can do. It is my feeling that a systems programmer, who works under TSO all day, will profit greatly from having an enhanced understanding of what the PSCB controls. Control of the OPER, MOUNT, JCL, and ACCOUNT attributes of your TSO session will help you accomplish many system tasks better. The macro IKJPSCB in SYS1.MACLIB, which maps the PSCB, describes the PSCB as a control block used to maintain user attributes and accounting data on a userid basis. The PSCB is established at LOGON time, it is unique for each TSO session, and it is userid oriented. Obviously, this control block plays a big part in determining the kind of power your TSO session will have. Bill Godfrey, a pioneer system software writer, wrote two TSO commands which allow a systems programmer to make best use of practical PSCB knowledge. These commands are LPSCB (list the PSCB) and CPSCB (change the PSCB). Obviously LPSCB, which does not do any alterations, can be made available to more users than CPSCB, which must run authorized, and which should be restricted to systems personnel only. Today, we will learn to use both of these commands profitably, to help us exploit the power of the PSCB control block. Of course, if you want to try this software yourself, you have to know where to obtain it. Both the LPSCB and CPSCB TSO commands can be found in source form on File 300 of the CBT MVS Utilities tape. The CBT Tape contains a world of useful software for MVS, and can be ordered through NaSPA. SOME PSCB EXAMPLES. Last month, we talked about using the REVIEW command to look at tape files, the same way you can use it to look at disk files. This power is greatly facilitated if your TSO session possesses the MOUNT attribute. Many people are of the opinion that the MOUNT attribute should not be on by default, even for systems programmers, because you may inadvertently interfere with tape operation from your TSO session. The most desirable scenario would be to turn MOUNT on only when you need it, keeping it off the rest of the time. Now, since the presence or absence of the MOUNT attribute is determined by the PSCB, you can therefore turn MOUNT on or off if you can change the appropriate bit in the PSCB for your session. At this point, one might ask the question: "Doesn't the security system (e.g. RACF) set this attribute?" The answer seems to be that RACF plays a part in initializing the PSCB with its session attributes during TSO LOGON processsing. However, once the session is active, TSO looks only at the PSCB to determine these session attributes. RACF is involved only at the beginning. Therefore, RACF will not interfere with what we want to do. So practically, if it is possible for you to install and authorize Bill Godfrey's CPSCB command for yourself, you can now enter a TSO command, "CPSCB MOUNT" or "CPSCB NOMOUNT" to toggle the MOUNT attribute on and off when you need it. To check on the current state of your session, you can use Bill Godfrey's "LPSCB" command to display whether the MOUNT attribute is currently on or off. Thus, if you'd want to use the REVIEW command (CBT MVS Tape - File 134) to browse a cataloged tape file and the MOUNT attribute is on, the TSO command "REVIEW tape.dsname" will cause a console tape mount message to be issued for operator response. The console message will ask the operator to mount the appropriate tape. If the MOUNT attribute is off, the TSO user will get an error message and no tape action will occur. Here's another example (for strict systems use only). Suppose your TSO broadcast dataset is full and the "BRODSCAN" batch program (CBT Tape Files 136, 437, 453) has been used to determine what filled it up. Your decision is that you want to clear the SYS1.BRODCAST dataset. However, there is the slight drawback that your TSO session does not have the ACCOUNT attribute. This can be discovered by using LPSCB, or by trying to execute IBM's "ACCOUNT" command and finding that it doesn't work. If CPSCB is installed and authorized, the command "CPSCB ACCOUNT" will remedy that situation. The command "CPSCB NOACCOUNT" could be used later to turn the ACCOUNT attribute back off. You can use LPSCB to check if CPSCB worked. Once the ACCOUNT attribute is on for your TSO session, you can use the "ACCOUNT" TSO command from IBM, and issue its SYNC subcommand to clear the SYS1.BRODCAST dataset of extraneous messages. Obviously, you'll want to be very careful to restrict these facilities to the smallest group possible. But as "system doctors", you'll find them to be extremely handy in your own work. ADDITIONAL INFORMATION. Figures 1 through 4 will help round out your practical knowledge on this subject, and will help show you where to look further. Figure 1 displays the output of the LPSCB command in its detail. The session shown has a lot of power, since most of the available attributes are turned on. It is instructive to compare the output of LPSCB with the IKJPSCB macro from SYS1.MACLIB, part of which is shown in Figure 3. You can, of course, see the full macro IKJPSCB by looking at it in SYS1.MACLIB on your own system. Figure 2 shows the TSO HELP member for LPSCB, and Figure 4 shows how to use the CPSCB command. I mentioned the subject of "personal" TSO authorization in a previous column (February 1993). All of my previous columns can be found on File 120 of the CBT Tape, so if you have a fairly new tape, you don't have to download the column from NasCOM. If you have access to the abovementioned "fairly new" CBT Tape, Files 185 and 186 will be especially helpful on this subject, and they will save you a lot of work. A useful manual describing TSO control blocks is: "A Guide to Writing a TMP or Command Processor" for older versions of TSO, or its successor, "TSO/E Version 2 Programming Services". Also, "TSO/E Version 2 Customization" will be helpful. "TSO Command Processor" programming examples abound all over the CBT Tape. Notable files to scan are: File 423 from my own TSO teacher, Jeff Broido, and the huge collection, File 300 from Jim Marshall. All this should serve as a haphazard introduction to the world of TSO in general, and as a practical aid to getting past some obstacles in your systems programming work. In any case, the path for learning is now open. You can walk on it if you wish. Good luck. See you next month. * * * * * * * * * * * * * * * * * * * * * * Figure 1. Output of the LPSCB TSO command. Notice that most fields of the PSCB are displayed, and many of them are interpreted. In my opinion, the most frequently used part of this display is PSCBATR1, whose flags control much of the TSO session's power. 8-character Userid Support is: OFF 00006F80 PSCB Address +0 PSCBUSER E2C2C7D6D3D6C2 SBGOLOB +7 PSCBUSRL 07 +8 PSCBGPNM F3F3F9F040404040 3390 +10 PSCBATR1 F380 OPER ACCT JCL CONS CNOP MOUNT RRBA +12 PSCBATR2 0000 +14 PSCBLTIM DCE515559D2DD8C2 2023.052 21:56.55.957213 +1C PSCBSUBH 00 +1D PSCBSUBC 00 +1E PSCBSUBM 00 +1F PSCBSOUT 00 +20 PSCBU8L 07 +21 PSCBDRBA 00006E +24 RESERVED 00000000 +28 PSCBDEST 0000000000000000 +30 PSCBRLGB 00007EF8 +34 PSCBUPT 00008FC8 +38 PSCBUPTL 0038 +3A PSCBCHAR 00 +3B PSCBLINE 00 +3C PSCBRSZ 000FFE00 +40 PSCBU 0000000000000000 +48 PSCBEXWD +48 PSCBEXK 00000000 +4C PSCBEXL 00000004 +50 PSCBEXD 00000000 +54 PSCBUID8 E2C2C7D6D3D6C240 SBGOLOB +5C RESERVED 00000000000000000000000000000000 +6C End-PSCB * * * * * * * * * * * * * * * * * * * * * * Figure 2. This is the TSO HELP member for the LPSCB command. It is self-explanatory. )F FUNCTION - 00010000 THE LPSCB (LIST PSCB) COMMAND LISTS THE PROTECTED STEP 00020000 CONTROL BLOCK (PSCB) IN A TSO USER'S REGION. 00030000 IT OPTIONALLY LISTS THE USER PROFILE TABLE (UPT). 00040000 00050000 )X SYNTAX - 00060000 LPSCB CPPL/REAL UPT 00070001 REQUIRED - NONE 00080000 DEFAULTS - CPPL 00090001 ALIAS - NONE 00100000 )O OPERANDS - 00110000 ))CPPL - THE PSCB ADDRESS IN THE CPPL WILL BE USED. 00120001 ))REAL - THE PSCB ADDRESS IN THE JSCB WILL BE USED. 00130001 ))UPT - LIST THE USER PROFILE TABLE TOO. 00140001 * * * * * * * * * * * * * * * * * * * * * * Figure 3. This is the beginning of the PSCB mapping macro IKJPSCB. Fields up to the two attribute bytes are shown. It is instructive to compare these fields with the LPSCB display shown in Figure 1. PSCB DSECT DS 0F PSCBUSER DS CL7 USERID PADDED RIGHT WITH BLANKS PSCBUSRL DS CL1 LENGTH OF USERID PSCBGPNM DS CL8 ESOTERIC GROUP NAME INIT BY LOGON @PD70423 * USED BY DYN ALLOC WHEN UNITNAME NOT SPECIFIED * BUT IS REQUIRED PSCBATR1 DS X A 16 BIT STRING OF USER ATTRIBUTES @YA43565 PSCBCTRL EQU X'80' OPERATOR COMMAND USER PSCBACCT EQU X'40' ACCOUNT COMMAND USER PSCBJCL EQU X'20' SUBMIT COMMAND USER PSCBVMNT EQU X'10' CNTL VOL MOUNT AUTH Y02669 PSCBATTN EQU X'08' LINE DELETE CHAR IS ATTENTION Y02669 PSCBRCVR EQU X'04' 0 -- EDIT RECOVER CAPABILTY @YA22385 ** 1 -- NORECOVER CAPIBILTY @YA22385 ** NOTE-- BIT PSCBRCVR IS USED DIFFERENTLY @YA22385 ** 1 MEANS NO EDIT RECOVERY CAPABILTY FOR THE USER @YA22385 PSCBRRBA EQU X'02' USER RBA CONTAINS INCORRECT ADDRESS OF @PD70423 * USER MAIL DIRECTORY, REPLACE WITH @E1113KS * PSCBDRBA AT LOGOFF @E1113KS PSCBCNAU EQU X'01' CONSOLE authority @E22D2D3 * BITS 8 - 15 RESERVED FOR IBM USE @E22D2D3 DS X RESERVED PSCBATR2 DS X A 16 BIT STRING CONTAINING THE USERDATA FIELD * @YA43565 DS X * *. . . The remainder of the DSECT has been deleted for brevity . . . * * * * * * * * * * * * * * * * * * * * * * * Figure 4. Syntax of the CPSCB TSO command. Once the CPSCB command is installed and authorized, it refers to the TSO session attributes as shown by the LPSCB command in Figure 1. Thus, to turn on/off attributes, you do the following: CPSCB (OPER|NOOPER) (ACCOUNT|NOACCOUNT) (JCL|NOJCL) (MOUNT|NOMOUNT)