Data Management Commands
Data Management Commands
There are several data management commands available for manipulating datasets and performing various operations on them. These commands are used to create, delete, rename, copy, and manipulate datasets in the TSO environment. Here are some commonly used data management commands in TSO -
ALLOCATE Command |
ALLOCATE (ALLOC) command used to dynamically defines and allocates a new dataset -
Syntax - ALLOC FILE(DDname) DA(dsname) [options]
Example - Allocate a new sequential dataset called MATEPK.TSO.TETPS.
|
LISTCAT Command |
The LISTCAT command lists the entries from master or user catalogs for the datasets or files.
This information includes dataset attributes, volume information, and catalog entries.
Syntax -
Example - List the information of the datasets starts with MATEPK.TSO.*
|
LISTDS Command |
The LISTDS command is used to display the list of datasets that match a given pattern or criteria.
Syntax -
Example - List the matching PDS information with qualifier.
This would display a list of all datasets that match the given pattern.
|
DELETE Command |
DELETE statement is used to delete one or more datasets or members from a partitioned dataset.
Syntax -
Example - delete a dataset.
This would delete the MATEPK.ISPF.TESTPDS dataset from the system.
|
RENAME Command |
RENAME statement is used to rename a dataset or member in a partitioned dataset.
Syntax -
Example - Rename dataset.
This would rename MATEPK.COBOL.SRCLIB members to MATEPK.COBOL.SRCLIB1.
|
ATTRIB Command |
ATTRIB command is used to display or modify the attributes of a dataset or a member of a partitioned dataset.
Syntax -
Example - Change the dataset from PS to PDS.
This would change the dataset organization of MATEPK.COBOL.TEST to PDS.
|
LISTALC Command |
LISTALC command is used to display information about all datasets that are currently allocated by the system.
Syntax -
Example - List datasets allocated to job.
This would display a list of all datasets that are currently allocated by the MYJOB job.
|
FREE Command |
FREE command is used to deallocate a dataset that has been previously allocated.
Syntax -
Example - Deallocate a dataset named MATEPK.TSO.TESTPS.
This command will deallocate the MATEPK.TSO.TESTPS dataset, freeing up the system resources that were previously used by the dataset.
|
PRINT Command |
PRINTDS command is used to print the contents of a dataset to a printer or a display terminal. It is similar to the PRINT command.
Syntax -
Example - Printing the dataset information.
This would print MATEPK.TSO.TESTPDS information on the printer attached to the system.
|
COPY Command |
The COPY command is used to copy the contents of one or more datasets to another dataset or to a sequential file.
Syntax -
Example - Copy data from one PDS to another.
This would copy MATEPK.TSO.TESTPDS members to MATEPK.TSO.TESTPDS1.
|