Packages(Experimental)


Step 5: Create a Help File

Every package should contain help in at least two formats: a short plain text file that describes the syntax of functions, and a PDF or HTML file that contains the complete documentation. The root name for the PDF and plain-text help files must match the case that you specified for the NAME keyword in the info.txt file. For example, the help files for the RightTriangle package must be RightTriangle.pdf and RightTriangle.txt. If you create an HTML file, the name of the file must be index.html or index.htm. All help files should be in the help subdirectory.

An example of a PDF help file is included with the AboveBelow package, which is distributed with SAS/IML software and is installed in the SYSTEM collection.

For simplicity, this step creates only a plain text file that documents the syntax of the functions in the RightTriangle package. Navigate to the help subdirectory, and use a text editor to create a file called RightTriangle.txt. Insert the following text and save the file:

   RightTriangle Package

   Description: Computes side lengths for right triangles

   Modules: 
   ISRIGHTTRIANGLE(v);
   Given a three-element vector that contains the three side lengths 
   of a triangle, this function returns 1 if the triangle is a right 
   triangle and 0 otherwise.

   FINDLEG(v);
   Given a two-element vector that contains the lengths of the 
   hypotenuse and a leg of a right triangle, this function finds 
   the length of the other leg.

   FINDHYPOTENUSE(v);
   Given a two-element vector that contains the lengths of two legs of
   a right triangle, this function finds the length of the hypotenuse. 

The PACKAGE HELP statement displays a help file for an installed package. The file that is displayed depends on how you are running the SAS/IML software:

  • The SAS/IML Studio application searches the help subdirectory for one of the following help files: PkgName.pdf, index.html, index.htm, or PkgName.txt, where PkgName is the name of your package. If a PDF or an HTML file is found, then that file is displayed.

  • In PROC IML, the PACKAGE HELP statement displays the PkgName.txt file in the SAS Log window. This is a convenient way to see the syntax for the package functions.

  • If SAS/IML is installed on a local or networked computer, you can use the PACKAGE INFO statement to discover the location of the directory where the package is installed. After you navigate to that directory, you can use a PDF viewer or a browser to view the documentation in the help subdirectory.

  • If you are running a SAS/IML program on a remote SAS server (such as through SAS Enterprise Guide or SAS Studio), you might not be able to navigate to the location of the help subdirectory. You might want to keep a copy of the package files (or the ZIP file) in a local directory so that you can browse the help files and view the source code.


Note: This procedure is experimental .