Date: Wed, 6 Nov 1996 14:29:16 -0500
Reply-To: julierog@ix.netcom.com
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: "Roger L. Lustig" <julierog@IX.NETCOM.COM>
Organization: Netcom
Subject: Re: Need help reading SAS dataset on PC
Frank Mulhern wrote:
>
> Hello:
>
> I have a sas dataset sent to me by someone else on a floppy disk. I want to
> read it into a SAS program. I understand that the way to do this is by
> specifying a LIBNAME and using the SET command to imnport the dataset.
> My program is:
>
> Data first;
> Libname data1 'c:\windows\sas\saswork\master.data';
> Set data1;
> proc print;
>
> The program cannot find the sas dataset. Any suggestions would be very
> appreciated. I have not read in data this way before. Thanks.
Two things:
a) if you're using a SAS dataset, the LIBNAME statement should
point to a directory, not to a file. Accordingly:
Data first;
Libname data1 'c:\windows\sas\saswork';
Set data1.master;
proc print;
b) if the second part of the file name is .data, or anything
other than .ssd or .sd2, you're not dealing with a SAS
dataset--or it's misnamed. Try copying and renaming (sd2
is for Windows versions); if it's not a SAS dataset, you'll
have to read it in with an INPUT statement. In that case
you'll want to refer to the external file using a FILENAME,
which *does* point to a particular file.
c) Could it be that the file is in a transport format?
Ask your colleague. If it's in XPORT format, then your
LIBNAME *should* point to the file (not the directory)
and the keyword XPORT should appear directly after the
name you assign:
Libname data1 XPORT 'c:\windows\sas\saswork\master.data';
Good luck!
Roger