Chapter Contents

Previous

Next
LIBNAME

LIBNAME


Associates a libref with a SAS data library or lists file attributes for a SAS data library

Valid: anywhere
CMS specifics: libref, engine, physical-name, engine/host-options


Syntax
Details
See Also

Syntax

LIBNAME libref <engine> 'physical-name' | ('physical-name-1' libref 'physical-name-n') | ('physical-name-1'... 'physical-name-n') <engine/host-options>;
LIBNAME libref | _ALL_ CLEAR;
LIBNAME libref | _ALL_ LIST;

libref
is a first-level SAS name that identifies the library. The libref can be a maximum of eight characters. The first character must be a letter (A through Z) or an underscore (_). The remaining characters can be any of these characters or numerals (0 through 9). This libref is used to reference the library throughout SAS.

engine
is a SAS name that identifies the engine to be loaded to process the library. The default engine that is used for new libraries is the BASE engine. Valid values for engine include the following:

V7 (BASE)
specifies the engine for accessing SAS files in the latest format available.

V7TAPE
specifies the engine for accessing SAS files in the latest sequential format, either on tape or disk.

V6
specifies the engine for accessing SAS data sets that were created under the Version 6 releases of SAS.

V6TAPE
specifies the engine for accessing SAS files in the Version 6 sequential format, either on tape or disk.

V5 (V5TAPE)
specifies the engine for accessing SAS data sets that were created under the Version 5 releases of SAS.

BMDP
specifies the engine for accessing BMDP files.

ORACLE
specifies the engine for accessing ORACLE data sets.

OSIRIS
specifies the engine for accessing OSIRIS files.

SPSS (SPSSX)
specifies the engine for accessing SPSS files.

SQLDS
specifies the engine for accessing SQL data sets.

SQLVIEW
specifies the engine for accessing SQL data views.

XPORT
specifies the engine for accessing files in transport format.

See Using SAS Engines for more details on engines.

'physical-name'
is a quoted string that describes the physical location of the library. The physical-name can be specified in the following ways:

'filemode'
specifies the disk-mode letter or the disk-mode letter and filemode access number. Use this form for physical-name when you want to use a filemode other than the default. If you specify filemode as an SFS directory, ", or `*', SAS uses the standard CMS search order to locate an existing SAS library. If the library exists on more than one minidisk, then SAS stops searching as soon as it finds a member. Consequently, only the member on that minidisk is used. Otherwise, if the library does not exist, the assignment defaults to the first read or write accessed disk.

'filetype filemode'
specifies the filetype to be used for the library and the disk-mode letter. filemode can also include a filemode access number. Use this form for physical-name when you want to use the libref as an alias for the filetype and you are using the BASE engine. This form is required when specifying a set of concatenated physical names.

'filename filetype filemode'
specifies the complete CMS file id. Use this form for physical-name with the BMDP, OSIRIS, SPSS, and XPORT engines.

'TAPn'
specifies the tape device for a sequential library. n is a hexadecimal character, which can be 0-9, A through F.

engine/host-options
is a list of host and engine options to be applied to this library. When specifying more than one option, use a blank space to separate each option. engine/host-options can be specified in the following format:

option-1=value option-2=value

The following list presents valid options for engine/host-options. Of these options, only the BLKSIZE= option is meaningful with disk libraries. All of the others are for sequential format libraries only.

BLKSIZE=nnnnn
specifies the logical block size in bytes of the file. nnnnn must be greater than 0 but less than or equal to 32,760. The default is 32,760.

DENSITY=
specifies the tape density. Valid values are

If the DENSITY= option is not specified, the tape density will be the density that the tape drive was last assigned.

DSN=
specifies the OS/390 data set name (one- to eight-byte qualifiers separated by periods, up to 44 characters long, including periods) of a SAS data set residing on OS/390-shared DASD. Enclose the value in single quotes.

EOV=
specifies whether there is automatic limited end-of-volume processing when the end of the tape is sensed on output. Valid values are
YES specifies that there is end-of-volume processing. This is the default.
NO specifies that there is not end-of-volume processing.

LABEL=
specifies the type of tape label. Valid values are
SL <n> specifies the IBM standard label. n is the position of the file on a multifile volume. If n is not specified, 1 is assumed.
NL <n> specifies that the tape has no IBM standard labels. n is the position of the file on a multifile volume. If n is not specified, 1 is assumed.
BLP <n> specifies that label processing is to be bypassed, but that the tape is to be positioned before the library is processed. n is the position of the file on a multifile volume. If n is not specified, 1 is assumed.
LABOFF specifies that there is to be no label processing. The tape is not positioned if this value is specified. This is the default.

LEAVE=
specifies whether a standard label tape is to be moved before processing the label. This option is valid only when LABEL=SL is specified. Valid values are
YES specifies that the tape is not to be moved before processing the label.
NO specifies that the tape is to be rewound before processing the label. This is the default.

SYSPARM=
passes an option string to a tape management system for standard label tapes. See Working with SAS Files on Tape for further information.

TRACK=
specifies the tape setting. Valid values are

VOLID=vvvvvv
specifies the one- to six-character serial number that identifies the volume. If the vol id is not a valid SAS name, you can use quotes around it to prevent SAS from attempting to parse the vol id as multiple tokens. This option is valid only when it follows LABEL=SL.


Details

The LIBNAME statement can also list or clear librefs. See SAS Language Reference: Dictionary for information about using the LIBNAME statement for these purposes.

You can use the LIBNAME statement to list attributes of SAS data libraries. Data Library Attributes Listed by the LIBNAME Statement shows the results of the following LIBNAME statement:


libname sashelp list;

Data Library Attributes Listed by the LIBNAME Statement
   NOTE: Copyright (c) 1989-1998 by SAS Institute Inc., Cary, NC, USA.
   NOTE: SAS (r) Proprietary Software Release 7.01  TSxxx
     Licensed to SAS INSTITUTE DATA CENTER, Site xxxxxxxxx.
   NOTE: Running on IBM Model 3090 Serial Number xxxxxx.

   1    libname sashelp list;
   NOTE: Libref=   SASHELP
     Engine=   V7
     Filefmt=  701
     Physical Name= SAS4HELP SG
   NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414


See Also


Chapter Contents

Previous

Next

Top of Page

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.