ALLOCATE
a data setATTRIB
for anALLOCATE
command- Release a previously allocated data set
SMCOPY
a data setRENAME
a data setDELETE
a data set or a data set member- Display current job status of jobs that you have submitted
- View the version of the system software
- Concatenate dataset to a SYSPROC ddname
- Display the dataset names and ddnames currently in use in your TSO session
CANCEL
a job
The ALLOCATE
command can be used to allocate PDS, PDS member, GDG, temporary data set, similar new dataset, PS, PDS/E, etc.
Examples:
Creating PDS with following parameters
- Record length: 80
- Record format: Fixed
- Space: 2 cylinder for both primary and secondary allocation
- Directory blocks: 10
ALLOCATE DATASET(#dsname) NEW DIR(10) CYLINDERS SPACE(2,2) DSORG(PO) RECFM(F) LRECL(80) BLKSIZE(80) CATALOG
To allocate PDSE specify DSNTYPE(LIBRARY)
. We don't have to specify DIR
here. Anyway, it's PDSE. The system will ignore it.
ALLOCATE DATASET(#dsname) NEW CYLINDERS SPACE(2,2) DSORG(PO) DSNTYPE(LIBRARY) RECFM(F) LRECL(80) BLKSIZE(80) CATALOG
Creating PS with following parameters
- Record length: 80
- Record format: Fixed Blocked
- Space: 2 cylinder for both primary and secondary allocation
ALLOC DA(#dsname) DSORG(PS) SPACE(2,2) TRACKS LRECL(80) BLKSIZE(800) RECFM(F,B) NEW
Creating a data set using LIKE
Allocate a new file #dsname2 which has similar properties as the file #dsname1 with a different space parameter which is 4 for primary and 2 for secondary (overriding some parameters).
ALLOC DA(#dsname2) SPACE(4,2) TRACKS LIKE(#dsname1)
ATTRIB
specifies a list of attributes. So then we can use it for a data set allocation. List remains for the duration of the TSO session or until explicitly released with FREE command.
ATTRIB TESTATTR LRECL(80) BLKSIZE(80) RECFM(F) DSORG(PO)
ALLOC DA(#dsname) USING(TESTATTR) NEW CYLINDERS SPACE(2,2) DSNTYPE(LIBRARY) CATALOG
FREE ATTRLIST(TESTATTR)
RENAME #old_name #new_name
To delete a data set with help of TSO command, type:
TSO DELETE '#dsname'
The shorthand of DELETE
is DEL
.
Note: it's better to provide a data set name within the quotation mark ''.
You can copy a data set to either a new or existing data set
With SMCOPY
we can copy:
- a PDS member into another PDS or PDS/E
TSO SMC FDS(#pdsname1(#mem)) TDS(#pdsname2(#mem)) NOTRANS
- a PDS member into a sequential data set
TSO SMC FDS(#pdsname(#mem)) TDS(#sequential_data_set) NOTRANS
Note: you can specify the line numbers that interest you by adding the keyword LINE(n:m)
, for instance, LINE(3:6) will copy 3, 4, 5, 6 records of a data set
STATUS
TSO ISPVCALL STATUS
ALLOC DDN(SYSPROC) SHR REUSE DSN('#dsname')
TSO FREE DA(#dsname)
LISTALC STATUS HISTORY SYSNAMES
- Cancel
TSO CANCEL #job_name(#job_id)
- Cancel and discard the printed output
TSO CANCEL #job_name(#job_id) PURGE