Kaleb
Kaleb

Reputation: 1022

How can I create a SAS library using existing SAS files?

I have a directory containing a set of SAS scripts, data files and also csv files. I want to now associate this directory with a library in SAS. I've created a library with the path name to the directory but the contents of the library are empty when I look via SAS but not via Windows Explorer.

How can I create a SAS library with all of these existing files inside it?

Using Windows 8 SAS 9.3

PS. New to SAS hence what is possibly a very easy question.

Upvotes: 0

Views: 317

Answers (1)

Robert Soszyński
Robert Soszyński

Reputation: 1188

A SAS library can contain objects such as SAS tables, SAS views, SAS catalogs (only SAS can read this catalog, on the operating system it's just a file).

In SAS catalog you can write e.g. SAS formats, SAS macros.

To assign a library use a libname statment.

libname libref base "path_to_OS_catalog";

If you want to read a file using SAS e.g. CSV, TXT files, use a filename statment. Check a documentation for examples.

filename fileref "path_to_file";

In other words, it's correct that your library is empty, because in a OS catalog there are no SAS objects.

Upvotes: 2

Related Questions