z/OS TSO/E User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


What is Allocation?

z/OS TSO/E User's Guide
SA32-0971-00

Allocation is the process of requesting access to a data set. If you allocate a data set that exists, the system allows you to open the data set. If you allocate a data set that does not exist, the system creates space for it on an available device and allows you to open that space.

A program that requires input and output must be able to open the appropriate data sets before it can run. When a data set is allocated, its resources can be accessed, such as lines of code, input data, or text. You can connect data sets to a program through allocation to a ddname used by the program. If the data set is not connected to a program through allocation to a ddname, the data set should be cataloged.

When running programs in the background, you use job control language (JCL) data definition (DD) statements to allocate the data sets needed for the program. When the job step is over, the data sets are automatically deallocated or freed.

Example of JCL Allocation
⋮
//SYSIN  DD     DSN=IN.DATA,DISP=SHR …
//SYSPRT DD     DSN=OUT.DATA,DISP=(NEW,CATLG) …
⋮

When running programs in the foreground, you can use the ALLOCATE command to allocate the data sets needed for the program. When the program finishes, the data sets remain connected to the program until you free them.

Example of Allocation with the ALLOCATE Command
ALLOCATE DATASET(in.data) FILE(sysin) SHR REUSE
ALLOCATE DATASET(out.data) FILE(sysprt) NEW …

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014