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


Accessing More Than One Data Set - Concatenation

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

You can provide more than one data set as input to a program by concatenating a group of data sets to a ddname. Concatenation means logically linking data sets in a series or chain. You concatenate data sets by issuing the ALLOCATE command as follows:

Example
ALLOCATE FILE(indata) DATASET(a.data,b.data,c.data)

The search order of data sets within a concatenation is very important. When a program searches through concatenated data sets for a particular item to use as input, it ends its search when it finds the first instance of the item. If correct input is in a member of a partitioned data set and another partitioned data set, earlier in the concatenation, has the same member name, the correct input is not accessed.

Example
You want to execute a CLIST named SETUP that is a member of PREFIX.MY.CLIST and also a member of PREFIX.SYSTEM.CLIST. Both data sets are allocated to file SYSPROC in your LOGON procedure with the following JCL DD statement:
//SYSPROC   DD    DSN=PREFIX.SYSTEM.CLIST,DISP=SHR
//                DSN=PREFIX.PROJECT.CLIST,DISP=SHR
//                DSN=PREFIX.MY.CLIST,DISP=SHR
You issue the command:
EXEC (setup)
The member SETUP of the data set PREFIX.SYSTEM.CLIST executes because it appears in the list before the other data set.

You can change the search order of data sets by using the ALLOCATE command and listing the data sets in the order in which you want them searched. Controlling search order is useful when you are developing data and want to have several versions of the same data.

Example
To change the concatenation of the data sets in ddname SYSPROC so that PREFIX.MY.CLIST is searched first, enter the following:
ALLOCATE FILE(sysproc) DATASET(my.clist,system.clist,project.clist)
      SHR REUSE

The above command deallocates the ddname and then reallocates the data sets in reverse order of the previous example.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014