Language Reference


PACKAGE LIBNAME Statement

(Experimental)

  • PACKAGE LIBNAME libref packagename;

The PACKAGE LIBNAME statement is experimental in SAS/IML 14.1. The PACKAGE LIBNAME statement creates a SAS libref that points to the data directory for a package. You must load a package before you can use the PACKAGE LIBNAME statement.

You must specify the following arguments:

libref

specifies the name of a SAS libref to be created.

packagename

specifies the name of the package.

The PACKAGE LIBNAME statement is used to access data in a package. For examples, the following statements read data from the AboveBelow package, which is installed in the SYSTEM collection:

package load AboveBelow;
package libname ABdata AboveBelow;
/* use the libref to read data that the package provides */
use ABdata.example;
   read all var _NUM_ into X[colname=varNames];
close ABdata.example;
print varNames;

Figure 25.269: Reading Data from a Package

varNames
x1 x2 x3



The READ statement reads the numerical variables into the matrix . FigureĀ 25.269 shows that the example data set contains numerical variables named x1, x2, and x3.

You must specify exactly one package in the PACKAGE LIBNAME statement.