The LIBNAME Statement

The LIBNAME statement is a global SAS statement that manipulates librefs. In IMLPlus, it is normally the case that you must place global SAS statements in a SUBMIT block or prefix the statement with the @ character. However, IMLPlus provides limited support for the LIBNAME statement as a native IMLPlus statement.

The LIBNAME statement has many different forms. IMLPlus only supports the following forms:

IMLPlus also supports an IMLPlus-specific form of the LIBNAME statement that accepts an IML expression:

libname libref (SAS-library-expression);

The SAS-library-expression argument must evaluate to a scalar character matrix. IMLPlus processes the LIBNAME statement as if it were

libname libref "evaluated-SAS-library-expression";

If you need to use a form of the LIBNAME statement that is not supported by IMLPlus, you must submit the LIBNAME statement to SAS for processing.

Examples

Example 1: Using the LIBNAME statement with a string argument
libname samples "C:\Program Files\SASHome\SASIMLStudio\12.1\Data Sets";
Example 2: Using the IMLPlus-specific LIBNAME statement with an expression argument
run GetInstallationDirectory( path );
path = path + "Data Sets";
libname samples (path);
Example 3: Submitting a LIBNAME statement with the @ character
@libname Temp clear;
Example 4: Submitting a LIBNAME statement with a SUBMIT block
librefs = "SASUSER SASHELP";
submit librefs;
    libname MyLibs (WORK &librefs);
endsubmit;
Example 5: Submitting a LIBNAME statement with the method SAS.SubmitStatements
statement = "libname MyLibs (WORK SASUSER SASHELP);";
SAS.SubmitStatements( statement );