Path variables are shortcuts to directories or files. Rather than enter the entire path to the directory or file, you use the path variable in a script. A path variable is a special type of string and is always contained within double quotation marks.
One common predefined path variable in JMP is $SAMPLE_DATA. This variable points to the sample data folder in your JMP or JMP Pro installation folder. The following example opens the Big Class.jmp sample data table.
The second argument in Register Addin() is assigned to this variable. See the Register Addin() section of the JSL Syntax Reference for details.
When you create an add-in through Add-In Builder, the $ADDIN_HOME definition is based on your computer’s operating system:
Windows: "C:/Users/<username>/AppData/Roaming/SAS/JMP/Addins/"
Macintosh: "/Users/<username>/Library/Application Support/JMP/Addins/"
Windows (JMP): "/C:/ProgramData/SAS/JMP/<version number>/"
Windows (JMP Pro): "/C:/ProgramData/SAS/JMPPro/<version number>/"
Windows (JMP Shrinkwrap): "/C:/ProgramData/SAS/JMPSW/<version number>/"
Macintosh: "/Library/Application Support/JMP/<version number>/"
Windows: "/C:/Users/<username>/Desktop/"
Macintosh "/Users/<username>/Desktop/"
Windows: "/C:/Users/<username>/Documents/"
Macintosh: "/Users/<username>/Documents/"
Windows (JMP): "C:/Users/<username>/AppData/Roaming/SAS/JMP/<version number>/”
Windows (JMP Pro): "/C:/ProgramData/SAS/JMPPro/<version number>/"
Windows (JMP Shrinkwrap): "/C:/ProgramData/SAS/JMPSW/<version number>/"
Macintosh: "/Users/<username>/"
Windows: /C:/<JMP installation directory>/Samples/Apps/"
Macintosh: "/Library/Application Support/<JMP installation directory>/Samples/Apps/"
Windows: "/C:/<JMP installation directory>/Samples/Data/"
Macintosh: "/Library/Application Support/<JMP installation directory>/Samples/Data/"
Windows: "/C:/<JMP installation directory>/Samples/Images/"
Macintosh: "/Library/Application Support/<JMP installation directory>/Samples/Images/"
Windows: "/C:/<JMP installation directory>/Samples/Import Data/"
Macintosh: "/Library/Application Support/<JMP installation directory>/Samples/Import Data/"
Windows: "/C:/<JMP installation directory>/Samples/Scripts/"
Macintosh: "/Library/Application Support/<JMP installation directory>/Samples/Scripts/"
Windows: "/C:/Users/<username>/AppData/Roaming/Temp/"
Macintosh: "/private/var/folders/.../Temporary Items/"
Windows (JMP): "/C:/Users/<username>/AppData/Roaming/SAS/JMP/<version number>/"
Windows (JMP Pro): "/C:/ProgramData/SAS/JMPPro/<version number>/"
Windows (JMP Shrinkwrap): "/C:/ProgramData/SAS/JMPSW/<version number>/"
Macintosh: "/Users/<username>/Library/Application Support/JMP/<version number>/"
Note that you don’t include a dollar sign for Set Path Variable() or Get Path Variable(). But you must include the dollar sign when using the variable in a script.
Make sure to include a trailing slash after the path variable. In the following example, the root name "Big Class" is assigned to the dtName variable. The Open expression evaluates $SAMPLE_DATA and the trailing slash and then appends the dtName value along with the file extension .jmp.
Without the slash that follows $SAMPLE_DATA, the path is interpreted as:
You can create your own path variables or override some of the built-in variables with the Set Path Variable(). In the following example, the path variable is called root. The variable points to the c:/ directory.
Get Default Directory(); // returns "c:/users/smith/data"
resolves as C:/users/smith/data/cleansers.jmp.
In JMP, the preferred file path format is the Portable Operating System Interface (POSIX), or UNIX, format with forward slashes (/) as separators. This means that you do not have to identify the current operating system in scripts run on both Windows and Macintosh. However, each host still accepts its native format for compatibility.
You can a convert file path format from Windows to POSIX (and vice versa) using Convert File Path(). Converting from a POSIX to a Windows path might be useful when you need to output a path to a file or to another application. The syntax is:
You can substitute a path variable (such as $HOME) for the path inside quotes.