Packages(Experimental)


Step 4: Create a Program File

Examples are very useful to the programmers who will download and use your package. Create a file named Example.sas in the programs directory. Include the following SAS/IML statements in the file and save the file:

/* Examples of calling modules in the RightTriangle package. If you have
   not installed the package, modify and run the following statements:

   proc iml;
   package install "C:\<path>\righttriangle.zip";
   quit;
*/
proc iml;
package load RightTriangle;

Rt = IsRightTriangle({3 4 5});     /* 1 = valid lengths     */
NotRt = IsRightTriangle({5 6 7} ); /* 0 = not valid lengths */
print Rt NotRt;

leg = FindLeg({3 5});           /* find 2nd leg from hypotenuse and leg */
hypot = FindHypotenuse({3 4});  /* find hypotenuse from legs */
print leg hypot;                /* correct answer is {4 5} */
quit;

The Example.sas file contains an example of calling each function in the package, and the comments provide the correct answer to each call. Programmers who want to use the package can study the program and modify it for their own use. The program also serves as a simple test program.


Note: This procedure is experimental .