Allocating External Files on Tape

Tapes are used primarily in batch mode. Some sites might restrict or prohibit tape mounts in interactive sessions. Because file allocation for external files on tape is done infrequently, the FILENAME statement and FILENAME function give only limited support for parameters that are normally associated with data sets on tape. However, you can use the FILENAME statement or FILENAME function to allocate a cataloged tape file, provided that you specify the data set name and disposition (as you would normally do in a JCL DD statement). To allocate an uncataloged tape file, do the following:
  • For a data set on an IBM standard-label tape (label type SL, the most common type), you must specify the data set name, UNIT= parameter, and volume serial number. You can also specify the label number and type and the disposition, or you can allow default values to be used for these parameters. For example:
    filename mytape 'prod.data' vol=myvol
       unit=tape label=(2,SL);
  • For a data set on a nonlabeled tape (label type NL), you must supply the above information plus DCB information. For more information, see DCB Attribute Options. For example:
    filename tranfile 'sas.cport.data'
       disp=(new,keep) unit=tape vol=xvol
       label=(1,NL) recfm=fb
       lrecl=80 blksize=8000;