TechInfo:OS:IBM Mainframes:TSO
From neurotica.com
Contents |
Definition of filename and dataset name
File or Dataset Name
First, we have the 'FILE()' parameter. That's just the DD name. For those not familiar with OS/3x0: the DD-name is the logical name which is used by a program that opens a dataset. Dataset name is the actual name of the file that is accessed.
Modern TSO allows you to use DD() or DS() for these - that makes it more compatible with JCL. On OS/360 this wasn't the case. So you must use FILE() or FI() for the DD name and DA() for the dataset name.
The same is true for error messages. FILE IN USE means that the DD name is not available, while DATASET IN USE means that somebody is using the physical dataset you requested.
TSO Prefix
Whenever you enter a dataset name in TSO without single quotes around it, TSO will add your PREFIX in front of it. Some commands will even add a last qualifier automatically. Under MVT you cannot change or disable this prefix.
Maintaining User Accounts
To add, modify or delete TSO userids you need to have the account privilege. After installing TSO, there is only one account, IBMUSER, which has all privileges.
The TSO account also defines which logon procedures (must be in SYS1.PROCLIB) can be used and if a user has to enter a password to use his account. In this document it is assumed that you give a user one password and probably multiple accounts. To create or manage accounts without password simply use '*' (sans quotes) as the password. It is assumed that you'll use the default logon procedure IKJACCNT. The alloc/free commands should only be used when the SYSUADS is not a DD card in the logon procedure. NOTE: with ACCOUNT you cannot modify a userid that is currently logged on.
Create a new userid
alloc fi(sysuads) da('sys1.uads') shr
account
add (newuser password * IKJACCNT) JCL [OPER] [ACCNT]
end
free fi(sysuads)
OPER and ACCNT give the user the right to use the OPER command (quite restricted operator console under TSO) or to use the ACCOUNT command (makes him a userid administrator).
Add an additional logon procedure to an account
alloc fi(sysuads) da('sys1.uads') shr
account
add (user password *) data(new-procname)
end
free fi(sysuads)
Change an account's password
alloc fi(sysuads) da('sys1.uads') shr
account
change (user old-password) data(new-password)
end
free fi(sysuads)
Change an account's privileges
alloc fi(sysuads) da('sys1.uads') shr
account
change (user) [[NO]JCL] [[NO]OPER] [[NO]ACCNT]
end
free fi(sysuads)
Delete an account
alloc fi(sysuads) da('sys1.uads') shr
account
delete (user)
end
free fi(sysuads)
Creating new Datasets - ATTRIB/ALLOC
Create a new sequential dataset
attrib <attr-name> lrecl(<record-length>) recfm(<record-format>) alloc [fi(<ddname>)] da(<new-dataset>) new space(<pri> <sec>) using<attr-name> [volume(<volser>)]
Notes:
- <pri> and <sec> are specified in tracks.
- add DIR(<dirblocks>) to create a partioned dataset (PDS)
- <record-format>: F = fixed record length, V= variable record length, U=undefined record length (use for load libraries), B = blocked (not with U), M = machine control characters (printing), A = ANSI control characters (printing) - use spaces as separators between each option character (different from JCL!!)
- New datasets are always cataloged.
- use the FI() parameter to establish a DD-name of your choice. If you do not choose one, the system will use SYSxxxxx and you'll have to do a FREE DA(<dataset-name>) instead of FREE DD(<myfiname>) - if you want to use the new dataset for a program that you 'CALL', you should use the ddname of your program for FI() anyway ...
- Note that the new dataset takes one of your dynamic DD spaces ... so if you do not need it with an application program, FREE it with the FREE DA(<dataset>) or FREE DD(<ddname>) command
Create a new partioned dataset
attrib <attr-name> lrecl(<record-length>) recfm(<record-format>) alloc [fi(<ddname>)] da(<new-dataset>) new space(<pri> <sec>) dir(<dirblk>) using<attr-name> [volume(<volser>)]
Notes:
- The only difference between creating a sequential file or creating a PDS (Library, partioned dataset, however you may call it) is the specification of the DIR() parameter.
- Once the directory of a PDS is filled, you cannot (normally) expand it. You have to recreate the dataset. Don't mind, a directory block is only 256 bytes long ...
Attaching Existing Datasets to your TSO Session
With ALLOC you cannot only create a new dataset, you can also attach an existing dataset to your session. The TSO commands where you can specify a dataset name will do that dynamically for you. But if you want to run an application program (e.g. to debug with TSO TEST) you must allocate the files with ALLOC (and subsequently do a FREE command for them).
Attach a Dataset to the TSO Session
alloc [fi(<ddname>)] da(<existing-dataset>) {OLD|SHR|MOD}
Notes:
- This syntax assumes that the dataset has complete DCB for the program that you want to execute against it.
- '<existing-dataset>' may include a member name if it is a PDS. Note that you must also use this syntax to create a new member in an alreday existing PDS.
- use the FI() parameter to establish a DD-name of your choice. If you do not choose one, the system will use SYSxxxxx and you'll have to do a FREE DA(<dataset-name>) instead of FREE DD(<myfiname>) - if you want to use the new dataset for a program that you 'CALL', you should use the ddname of your program for FI() anyway ...
- Note that each dataset takes one of your dynamic DD spaces ... so if you do not need it with an application program, FREE it with the FREE DA(<dataset>) or FREE DD(<ddname>) command
Listing Dataset Names, Attributes and Members
To find out what datasets exist and what members they have, TSO offers you 2 basic commands: LISTCAT and LISTDS. Both only work for cataloged datasets. This means that you cannot use them to find out about the DLIBs on device 351.
What datasets exist under my user's prefix?
LISTCAT
The result is a list of all datasets that are allocated under your userid. The HLQ is not printed.
