Packages(Experimental)


Step 2: Create the Package Information File

The PACKAGE INSTALL statement reads the info.txt file, which must be in the root directory for the package. The file must be stored in UTF-8 format. The first line in the file, which tells the SAS/IML software how to interpret subsequent lines, must be as follows:

# SAS/IML Package Information File Format 1.0

Subsequent lines define keyword-value pairs. A keyword must begin in the first column and must be followed by a colon (:). The value that follows the colon is free-form text, unless otherwise noted. A value is ended by either a new keyword-value pair or a blank line. If a value requires more than one line of text, subsequent lines must be indented by at least one space or tab character.

If the first character on a line is the number sign (#), then the rest of the line is ignored. You can use the number sign to put comments in the info.txt file.

The SAS/IML language supports the following list of keyword-value pairs. Only the NAME keyword is required. If a keyword is marked "Reported," then that keyword-value pair (up to 100 characters) is displayed by the PACKAGE INFO statement.

NAME:

(Reported) Specify the name of the package. The package name must be a valid SAS name, which means it must contain 32 characters or less, begin with a letter or underscore, and contain only letters, underscores, and digits.

The case (uppercase, lowercase, or mixed case) of this keyword value is important for the following reasons:

  • The PACKAGE LIST and PACKAGE INFO statements display the value of the NAME keyword exactly as you specify it.

  • The help system looks for a file of the name PkgName.pdf or PkgName.txt, where PkgName is the exact value of the NAME keyword.

  • In the SAS/IML Studio application, the value determines the case of the name of the package’s directory.

DESCRIPTION:

(Reported) Specify a brief description of the package.

AUTHOR:

(Reported) Specify the authors of the package. Optionally, you can include contact information such as an email address or website.

VERSION:

(Reported) Specify the version of the package. The default value is 0.0.0.0. The version can have up to four levels, separated by decimal points (.). For example, valid values are 1.0, 2.7.1, and 3.1.4.1.

REQUIRESIML:

(Reported) Specify the version of SAS/IML software that is required to run the package. The default value is 14.1.0.0. The specified value must be greater than or equal to 14.1.0.0. You can specify this value when your package relies on a new feature of SAS/IML software.

SOURCEFILES:

Specify a list of the source filenames for the package, with one filename per line. The case (uppercase, lowercase, or mixed case) of this keyword value is important because certain file systems (such as Linux) are case-sensitive. The source files usually have a .sas or .iml extension.

If a source file uses a specific character encoding, you can add an equal sign (=) and a value that indicates the character encoding after the name of the source file. For example, the following statement indicates that the file contains characters in the Windows Latin1 encoding:

   File1.iml = wlatin1

It is not necessary to indicate the encoding of UTF-8 or UTF-16 files if the files begin with a byte-order mark. For more information about character encoding in SAS, see the section "Encoding Values in SAS Language Elements" in SAS National Language Support: Reference Guide.

Copyright:

Specify copyright information for the package.

License:

Specify an open-source license, such as those approved by the Open Source Initiative (http://opensource.org/licenses).

Dependencies:

Specify other packages that your package requires. Each package must be written on a separate line. A user must install the packages in this dependency list before installing the current package.

Notes:

Specify other information that the user needs to know in order to use the package.

For example, the keyword-value pairs in the following statements define a valid info.txt file for the RightTriangle package. To create this file, create a plain text file in the righttriangle directory, paste in the following text, and save the file.

# SAS/IML Package Information File Format 1.0
# Do NOT edit the line above!

Name: RightTriangle
Description: Computes side lengths for right triangles
Author: SAS/IML Development Team
Version: 1.0
SourceFiles: RightTriangle.iml
Notes: An example package from the SAS/IML documentation

Note: This procedure is experimental .