z/OS TSO/E Primer
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Allocating a data set like another

z/OS TSO/E Primer
SA32-0984-00

The ALLOCATE command has a very complex syntax because of the many data set attributes you can specify. Instead of learning the complex syntax, you can take a shortcut and allocate a data set like an existing one. Thus you can create a data set named PREFIX.NEWTEST.DATA with the same attributes as the one named PREFIX.TEST.DATA by entering after the READY message:
ALLOCATE DATASET(newtest.data) LIKE(test.data)
Notice that we didn't include the word prefix as the first qualifier. TSO/E assumes your prefix, sometimes your user ID, as the first qualifier unless the data set is placed within single quotation marks. The following is also correct:
ALLOCATE DATASET('prefix.newtest.data') LIKE('prefix.test.data')

Your prefix is typically assigned by an administrator and appears in your user profile. For more information about prefixes and user profiles, see Displaying a user profile.

For more information about the ALLOCATE command and its other functions, see z/OS TSO/E User's Guide.

Exercise
Be sure that you completed the previous exercises and that PREFIX.TEST.DATA exists. Then enter after the READY message the abbreviated version of the first ALLOCATE command example:
ALLOC DA(newtest.data) LIKE(test.data)

You then see another READY message, which indicates that the command was successful. If instead you see an error message or a prompting message, the command was unsuccessful.

Now enter the incorrect command:
ALLOC DA(brandnew.data) LIKE(prefix.newtest.data)
(The command is incorrect because the first qualifier prefix is included in the second data set name, but the data set is not enclosed in single quotation marks.)
You see:
  DATA SET PREFIX.PREFIX.NEWTEST.DATA NOT IN CATALOG OR
CATALOG CAN NOT BE ACCESSED
  ENTER MODEL DATA SET NAME -

Notice the double prefix in the above data set name.

If you want to correct the error and create a data set named PREFIX.BRANDNEW.DATA, you can type newtest.data in response to the message prompt. If you want to end the process and see another READY message, press the attention interrupt (PA1) key.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014