Packages(Experimental)


Installing, Loading, and Uninstalling a Package

Packages are distributed as ZIP files. The name of the ZIP file must be the package name. To install a package, specify the full path name of the ZIP file in the PACKAGE INSTALL statement. For example, if the file C:\Packages\RightTriangle.zip contains the source code for the RightTriangle package, you can install the package as follows:

proc iml;
package install "C:\Packages\RightTriangle.zip";
quit;

The PACKAGE INSTALL statement creates a subdirectory named righttriangle in a directory whose location is system-dependent and then unzips the contents of the ZIP file into that subdirectory. Although the SAS language is case-insensitive, some operating systems (notably Linux) are case-sensitive. When you specify a ZIP file on a case-sensitive operating system, be sure to match the case of the filename in the operating system.

By default, the PACKAGE INSTALL statement installs the package in the PRIVATE collection. For more information about the installation directory and the collections, see the section Collections of Packages.

The IML procedure also accepts a SAS fileref, as created by the FILENAME statement in Base SAS. Consequently, the following statements also install the RightTriangle package:

filename ThePkg "C:\Packages\RightTriangle.zip";
proc iml;
package install ThePkg;
quit;

You should install a package only once. The section Displaying Information about Installed Packages describes how to display information about the installed package.

When you want to call modules in the package, use the PACKAGE LOAD statement to load the package’s modules into a SAS/IML session, as described in the section Using a Package.

If you no longer need a package, you can use the PACKAGE UNINSTALL statement to uninstall the package.

Installing and uninstalling a package does not change or delete the ZIP file. Although you are free to delete the ZIP file from your local machine after you have installed the package, you might want to keep the ZIP file on your local machine if you are running SAS on a remote server. When SAS runs on a remote server, the help files and source files for the package are installed on the remote server. Consequently, it might be difficult to view or browse those files. If you keep the ZIP file on your local machine, you can locally access the help files and source files.


Note: This procedure is experimental .