Date: Sat, 17 Jan 1998 17:39:47 -0500
Reply-To: HERMANS1 <hermans1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: HERMANS1 <hermans1@WESTAT.COM>
Subject: Re: libname
Your message doesn't provide enough detail. Nonetheless, I would
guess that you need a quick overview to supplement the manual.
The LIBNAME sets up a symbolic reference to a system directory path
(except in the case of a SAS XPORT or transport dataset where it
refers to a file as if it were a directory). In all cases except
graphics catalogs and Access views, the name of a SAS dataset has a
two level name (x.y). For a permanent dataset name, you must define
the first part of the name in a LIBNAME statement (a work dataset has
the form WORK.y, but you can omit WORK. and SAS will use the default
WORK directory path).
The DATA statement in SAS Datasteps, the CREATE TABLE <> AS .... in
PROC SQL, and the OUT= option of some SAS procedures write SAS
datasets to the directory path specified or implied in a LIBNAME
statement. SET x.y ... statements in Datasteps, FROM x.y .. clauses in
SQL, and IN= options in some procedures initiate the reading of a
dataset. SAS reads the file named in a statement, option, or clause
either from the default WORK directory or from a directory specified
earlier in a LIBNAME statement and linked to a symbolic reference y in
a two-level name, y.x.
To read or write system files (ASCII or EBCDIC for example), you first
create a symbolic reference in a FILENAME statement. AFTER the
symbolic reference (and optionally a DEVICE type), you include a
directory path with both filename and filetype extension specified.
You do not (except in cases mentioned above) include either a file name
or type extension in a LIBNAME statement. SAS is looking for a reference or
pointer to a directory. Currently both the symbolic reference that follows
LIBNAME and the name of the SAS dataset on the directory path given in the
LIBNAME statement can have no more than eight characters. The same goes for
the symbolic reference that follows LIBNAME in a LIBNAME statement. This
means that both x and y in a two-level dataset name, x.y, could refer either
to directory paths or filenames. Many SAS beginners find this confusing.
You may have to read this a couple of times to understand all of the fine
distinctions between the syntax of SAS (for example, LIBNAME or FILENAME) and
the usual operating system references to directories and files. Hope this
____________________________ Original Message _________________________________
Author: Alan Jiang <weijiang@PEGASUS.RUTGERS.EDU> at Internet-E-Mail
Date: 1/17/98 4:45 AM
I copied an example from a book on how to use libname. But the output
file contains pure garbage. The output file is automatically assigned
extension "ssd". There is no error in the log file. Can somebody give
me clue what the problem could be?