Assignment Functions
JSL also provides operators for in-place arithmetic, or assignment operators. These operations are all done in place, meaning that the result of the operation is assigned to the first argument. The most basic assignment operator is the = operator (or the equivalent function Assign). For example, if a is 3 and you do a+=4, then a becomes 7.
The first argument to an assignment function must be something capable of being assigned (an L-value). You cannot do something like 3+=4, because 3 is just a value and cannot be reassigned. However, you can do something like a+=4, because a is a variable whose value you can set.
Add To(a, b)
a+=b
Description
Adds a and b and places the sum into a.
Returns
The sum.
Arguments
a
Must be a variable.
b
Can be a variable, number, or matrix.
Notes
The first argument must be a variable, because its value must be able to accept a value change. A number as the first argument produces an error.
For Add To(): Only two arguments are permitted. If one or no argument is specified, Add To() returns a missing value. Any arguments after the first two are ignored.
For a+=b: More than two arguments can be strung together. JMP evaluates pairs from right to left, and each sum is placed in the left-hand variable. All arguments except the last must be a variable.
Example
a+=b+=c
JMP adds b and c and places the sum into b. Then JMP adds a and b and places the sum into a.
See Also
The Data Structures chapter in the Scripting Guide.
Assign(a, b)
a=b
Description
Places the value of b into a.
Returns
The new value of a.
Arguments
a
Must be a variable.
b
Can be a variable, number, or matrix.
Notes
a must be a variable, because it must be able to accept a value change. A number as the first argument produces an error. If b is some sort of expression, it’s evaluated first and the result is placed into a.
Divide To(a, b)
a/=b
Description
Divides a by b and places the result into a.
Returns
The quotient.
Arguments
a
Must be a variable.
b
Can be a variable, number, or matrix.
See Also
The Data Structures chapter in the Scripting Guide.
Multiply To(a, b)
a*=b
Description
Multiplies a and b and places the product into a.
Returns
The product.
Arguments
a
Must be a variable.
b
Can be a variable, number, or matrix.
Notes
The first argument must be a variable, because its value must be able to accept a value change. A number as the first argument produces an error.
For Multiply To(): Only two arguments are permitted. If one or no argument is specified, Multiply To() returns a missing value. Any arguments after the first two are ignored.
For a*=b: More than two arguments can be strung together. JMP evaluates pairs from right to left, and each product is placed in the left-hand variable. All arguments except the last must be a variable.
Example
a*=b*=c
JMP multiplies b and c and places the product into b. Then JMP multiplies a and b and places the product into a.
See Also
The Data Structures chapter in the Scripting Guide.
PostDecrement(a)
a--
Description
Post-decrement. Subtracts 1 from a and places the difference into a.
Returns
a-1
Argument
a
Must be a variable.
Notes
If a-- or Post Decrement(a) is inside another expression, the expression is evaluated first, and then the decrement operation is performed. This expression is mostly used for loop control.
PostIncrement(a)
a++
Description
Post-increment. Adds 1 to a and places the sum into a.
Returns
a+1
Argument
a
Must be a variable.
Notes
If a++ or PostIncrement(a) is inside another expression, the expression is evaluated first, and then the increment operation is performed. Mostly used for loop control.
Subtract To(a, b)
a-=b
Description
Subtracts b from a and places the difference into a.
Returns
The difference.
Arguments
a
Must be a variable.
b
Can be a variable, number, or matrix.
Notes
The first argument must be a variable, because its value must be able to accept a value change. A number as the first argument produces an error.
For SubtractTo(): Only two arguments are permitted. If fewer than two or more than two arguments is specified, SubtractTo() returns a missing value.
For a-=b: More than two arguments can be strung together. JMP evaluates pairs from right to left, and each difference is placed in the left-hand variable. All arguments except the last must be a variable.
Example
a-=b-=c
JMP subtracts c from b and places the difference into b. Then JMP subtracts b from a and places the difference into a.
See Also
The Data Structures chapter in the Scripting Guide.
Character Functions
Most character functions take character arguments and return character strings, although some take numeric arguments or return numeric data. Arguments that are literal character strings must be enclosed in quotation marks.
The Types of Data chapter in the Scripting Guide provides more details about some of the functions.
Blob To Char(blob, <"encoding">)
Description
Reinterpret binary data as a Unicode string.
Returns
A string.
Arguments
blob
a binary large object.
encoding
Optional quoted string that specifies an encoding. The default encoding for the character string is utf-8. utf-16le, utf-16be, us-ascii, iso-8859-1, ascii-hex, shift-jis, and euc-jp are also supported.
Notes
The optional argument ascii is intended to make conversions of blobs containing normal ASCII data simpler when the data might contain CR, LF, or TAB characters (for example) and those characters do not need any special attention.
Blob To Matrix(blob, "type", bytes, "endian", <nCols>)
Description
Creates a matrix by converting each byte in the blob to numbers.
Returns
A matrix that represents the blob.
Arguments
blob
A blob or reference to a blob.
type
A quoted string that contains the named type of number. The options are int, uint, or float.
bytes
Byte size of the data in the blob. Options are 1, 2, 4, or 8.
endian
A quoted string that contains a named type that indicates whether the first byte is the most significant. Options are as follows:
"big" indicates that the first byte is the most significant.
"little" indicates that the first byte is the least significant.
"native" indicates that the machine’s native format should be used.
nCols
Optional. Specify the number of columns in the matrix. The default value is 1.
Char(x, <width>, <decimal>)
Description
Converts an expression or numeric value into a character string.
Returns
A string.
Arguments
x
an expression or a numeric value. An expression must be quoted with Expr(). Otherwise, its evaluated value is converted to a string.
width
optional number that sets the maximum number of characters in the string.
decimal
optional number that sets the maximum number of places after the decimal that is included in the string.
Note
The width argument overrides the decimal argument.
Example
Char( Pi(), 10, 4)
"3.1416"
 
Char( Pi(), 3, 4)
"3.1"
Char To Blob(string, <"encoding">)
Description
Converts a string of characters into a binary (blob).
Returns
A binary object.
Arguments
string
Quoted string or a reference to a string.
encoding
Optional quoted string that specifies an encoding. The default encoding for the blob is utf-8. utf-16le, utf-16be, us-ascii, iso-8859-1, ascii-hex, shift-jis, and euc-jp are also supported.
Notes
Converting BLOBS into printable format escapes (in addition to ~ " ! and characters outside of the printable ASCII range) into hex notation (~5C for the backslash character).
x = Char To Blob( "abcdef!n" );
y = Blob To Char( x, encoding = "ASCII~HEX" );
If(
y == "abc~5Cdef~0A", "JMP 12.2 and later behavior",
y == "abcdef~0A", "Pre-JMP 12.2 behavior"
);
"JMP 12.2 and later behavior" // output
Char To Hex(value, <"integer" | "encoding">)
Hex(value, <"integer" | "encoding">)
Description
Converts the given value and encoding into its hexadecimal representation.
Returns
A hexadecimal string.
Arguments
value
Any number, quoted string, or blob.
integer
Switch that causes the value to be interpreted as an integer.
encoding
Optional quoted string that specifies an encoding. The default encoding is utf-8. utf-16le, utf-16be, us-ascii, iso-8859-1, ascii-hex, shift-jis, and euc-jp are also supported.
Collapse Whitespace("text")
Description
Trims leading and trailing whitespace and replaces interior whitespace with a single space. That is, if more than one white space character is present, the Collapse Whitespace function replaces the two spaces with one space.
Returns
A quoted string.
Arguments
text
A quoted string.
Concat(a, b)
Concat(A, B)
a||b
A||B
Description
For strings: Appends the string b to the string a. Neither argument is changed.
For lists: Appends the list b to the list a. Neither argument is changed.
For matrices: Horizontal concatenation of two matrices, A and B.
Returns
For strings: A string composed of the string a directly followed by the string b.
For lists: A list composed of the list a directly followed by the list b.
For matrices: A matrix.
Arguments
Two or more strings, string variables, lists, or matrices.
Notes
More than two arguments can be strung together. Each additional string is appended to the end, in left to right order. Each additional matrix is appended in left to right order.
Example
a = "Hello"; b = " "; c = "World"; a || b || c;
"Hello World"
d = {"apples", "bananas"}; e = {"peaches", "pears"}; Concat( d, e );
{"apples", "bananas", "peaches", "pears"}
A = [1 2 3]; B = [4 5 6]; Concat( A, B );
[1 2 3 4 5 6]
Concat Items
Concat To(a, b)
Concat To(a, b)
a||=b
A||=B
Description
For strings: Appends the string b to the string a and places the new concatenated string into a.
For matrices: Appends the matrix b to the matrix a and places the new concatenated matrix into a.
Returns
For strings: A string composed of the string a directly followed by the string b.
For matrices: A matrix.
Arguments
Two or more strings, string variables, or matrices. The first variable must be a variable whose value can be changed.
Notes
More than two arguments can be strung together. Each additional string or matrix is appended to the end, in left to right order.
Example
a = "Hello"; b = " "; c = "World"; Concat To( a, b, c ); Show( a );
a = "Hello World"
A = [1 2 3]; B = [4 5 6]; Concat To( A, B ); Show( A );
A = [1 2 3 4 5 6];
Contains(whole, part, <start>)
Description
Determines whether part is contained within whole.
Returns
If part is found: For lists, strings, and namespaces, the numeric position where the first occurrence of part is located. For associative arrays, 1.
If part is not found, 0 is returned in all cases.
Arguments
whole
A string, list, namespace, or associative array.
part
For a string or namespace, a string that can be part of the string whole. For a list, an item that can be an item in the list whole. For an associative array, a key that can be one of the keys in the map whole.
start
An optional numeric argument that specifies a starting point. within whole. If start is negative, contains searches whole for part backwards, beginning with the position specified by the length of wholestart. Note that start is meaningless for associative arrays and is ignored.
Example
nameList={"Katie", "Louise", "Jane", "Jaclyn"};
r = Contains(nameList, "Katie");
The example returns a 1 because “Katie” is the first item in the list.
Contains Item(x, <item | list | pattern>, <delimiter>)
Description
Identifies multiple responses by searching for the specified item, list, pattern, or delimiter. The function can be used on columns with the Multiple Response modeling type or column property.
Returns
Returns a Boolean that indicates whether the word (item), one of a list of words (list), or pattern (pattern) matches one of the words in the text represented by x. Words are delimited by the characters in the optional delimiter (delimiter) string. A comma, ",", character is the default delimiter. Blanks are trimmed from the ends of each extracted word from the input text string (x).
Example
The following example searches for “pots” followed by a comma and then outputs the result.
x = "Franklin Garden Supply is a leading online store featuring garden decor, statues, pots, shovels, benches, and much more.";
b = Contains Item( x, "pots", "," );
If( b,
Write( "The specified items were found." ), "No match."
);
The specified items were found.
Ends With(string, substring)
Description
Determines whether substring appears at the end of string.
Returns
1 if string ends with substring, otherwise 0.
Arguments
string
A quoted string or a string variable. Can also be a list.
substring
A quoted string or a string variable. Can also be a list.
Equivalent Expression
Right(string, Length(substring)) == substring
Hex(value, <"integer" | encoding="enc")
Hex To Blob(string)
Description
Converts the quoted hexadecimal string (including whitespace characters) to a blob (binary large object).
Example
Hex To Blob( "4A4D50" );
Char To Blob("JMP", "ascii~hex")
Hex To Char(string, <encoding>)
Description
Converts the quoted hexadecimal string to its character equivalent.
Example
Hex To Char( "30" ) results in “0”.
Notes
The default encoding for character string is utf-8. utf-16le, utf-16be, us-ascii, iso-8859-1, ascii-hex, shift-jis, and euc-jp are also supported.
Hex To Number(string)
Description
Converts the quoted hexadecimal string to its integer or its floating number equivalent.
Example
Hex To Number( "80" );
128
Note
16-digit hexadecimal numbers are converted as IEEE 754 64-bit floating point numbers.
Whitespace between bytes (or pairs of digits) and in the middle of bytes is permitted (for example, FF 1919 and F F1919).
Insert
Insert Into
Item(n, string, <delimiters>)
Description
Extracts the nth word from a quoted string according to the quoted string delimiters given. The default delimiter is space. If you include a third argument, any and all characters in that argument are taken to be delimiters.
Note
Item() is the same as Word() except that Item() treats each delimiter character as a separate delimiter, and Word() treats several adjacent delimiters as a single delimiter.
Item( 4,"the quick, brown fox", ", " );
"brown"
Word( 4,"the quick, brown fox", ", " );
"fox"
Left(string, n, <filler>)
Left(list, n, <filler>)
Description
Returns a truncated or padded version of the original string or list. The result contains the left n characters or list items, padded with any filler on the right if the length of string is less than n.
Length(string)
Description
Calculates the number of characters (length) of the quoted string.
Lowercase(string)
Description
Converts any upper case character found in quoted string to the equivalent lowercase character.
Munger(string, offset, find|length)
Munger(string, offset, find, replace)
Description
Computes new character strings from the quoted string by inserting or deleting characters. It can also produce substrings, calculate indexes, and perform other tasks depending on how you specify its arguments.
Offset is a numeric expression indicating the starting position to search in the string. If the offset is greater than the position of the first instance of the find argument, the first instance is disregarded. If the offset is greater than the search string’s length, Munger uses the string’s length as the offset.
Num(string)
Description
Converts a character string into a number.
Regex("source", "pattern", (<replacementString>, <GLOBALREPLACE>), <format>, <IGNORECASE>)
Description
Searches for the pattern within the source string.
Returns
The matched text as a string or numeric missing if there was no match.
Arguments
source
A quoted string.
pattern
A quoted regular expression.
format
Optional. A backreference to the capturing group. The default is /0, which is the entire matched string. /n returns the nth match.
IGNORECASE
Optional. The search is case sensitive, unless you specify IGNORECASE.
GLOBALREPLACE
Optional with a replacement string. Applies the regular expression to the source string repeatedly until all matches are found.
Remove
Remove From
Repeat(source, a)
Repeat(matrix, a, b)
Description
Returns a copy of source concatenated with itself a times. Or returns a matrix composed of a row repeats and b column repeats. The source can be text, a matrix, or a list.
Reverse
Reverse Into
Right(string, n, <filler>)
Right(list, n, <filler>)
Description
Returns a truncated or padded version of the original string or list. The result contains the right n characters or list items, padded with any filler on the left if the length of string is less than n.
Shift
Shift Into
Starts With(string, substring)
Description
Determines whether substring appears at the start of string.
Returns
1 if string starts with substring, otherwise 0.
Arguments
string
A quoted string or a reference to one. Can also be a list.
substring
A quoted string or a reference to one. Can also be a list.
Equivalent Expression
Left(string, Length(substring)) = = substring
Substitute
Substitute Into
Substr(string, start, length)
Description
Extracts the characters that are the portion of the first argument beginning at the position given by the second argument and ending based on the number of characters specified in the third argument. The first argument can be a character column or value, or an expression evaluating to same. The starting argument and the length argument can be numbers or expressions that evaluate to numbers.
Example
This example extracts the first name:
Substr( "Katie Layman", 1, 5 );
The function starts at position 1, reads through position 5, and ignores the remaining characters, which yields “Katie.”
Titlecase("text")
Description
Converts the string to title case, that is, each word in the string has an initial uppercase character and subsequent lowercase characters.
Returns
A quoted string.
Arguments
text
A quoted string.
Example
For example, the following function:
Titlecase( "veronica layman ")
returns the following string:
"Veronica Layman"
Trim("text",<left|right|both>)
Trim Whitespace("text",<left|right|both>)
Description
Removes leading and trailing whitespace.
Results
A quoted string.
Arguments
text
A quoted string.
left|right|both
The second argument determines if whitespace is removed from the left, the right, or both ends of the string. If no second argument is used, whitespace is removed from both ends.
Example
For example, the following command:
Trim( "  John    ", both )
returns the following string:
"John"
Uppercase(string)
Description
Converts any lower case character found in the quoted string to the equivalent uppercase character.
Word(n, "text", <"delimiters">)
Description
Extracts the nth word from a character string according to the delimiters given. The default delimiter is space. If you include a third argument, any and all characters in that argument are taken to be delimiters.
Examples
This example returns the last name:
Word( 2, "Katie Layman" );
Note
Word() is the same as Item(), except that Item() treats each delimiter character as a separate delimiter, and Word() treats several adjacent delimiters as a single delimiter.
Item( 4,"the quick brown fox" );
"brown"
Word( 4,"the quick brown fox" );
"fox"
Words
XPath Query( xml, "xpath_expression")
Description
Runs an XPath expression on an XML document.
Returns
A list.
Arguments
xml
A valid XML document.
xpath_expression
A quoted XPath 1.0 expression.
Example
Suppose that you created a report of test results in JMP and exported important details to an XML document. The test results are enclosed in <result> tags.
The following example stores the XML document in a variable. The XPath Query expression parses the XML to find the text nodes inside the <result> tags. The results are returned in a list.
rpt =
"[<?xml version="1.0" encoding="utf-8"?>
<JMP><report><title>Production Report</title>
<result>November 21st: Pass</result>
<result>November 22nd: Fail</result>
<note>Tests ran at 3:00 a.m.</note></report>
</JMP> ]";
results = XPath Query( rpt, "//result/text()" );
{"November 21st: Pass", "November 22nd: Fail"}
Character Pattern Functions
See the Types of Data chapter in the Scripting Guide book for more detailed information on constructing and using pattern matching expressions.
Pat Abort()
Description
Constructs a pattern that immediately stops the pattern match. The matcher does not back up and retry any alternatives. Conditional assignments are not made. Immediate assignments that were already made are kept.
Returns
0 when a match is stopped.
Argument
none
Pat Altern(pattern1, <pattern 2, ...>)
Description
Constructs a pattern that matches any one of the pattern arguments.
Returns
A pattern.
Argument
One or more patterns.
Pat Any("string")
Description
Constructs a pattern that matches a single character in the argument.
Returns
A pattern.
Argument
string
a string.
Pat Arb()
Description
Constructs a pattern that matches an arbitrary string. It initially matches the null string. It then matches one additional character each time the pattern matcher backs into it.
Returns
A pattern.
Argument
none
Example
p = "the beginning" + Pat Arb() >? stuffInTheMiddle + "the end";
Pat Match( "in the beginning of the story, and not near the end, there are three bears", p );
Show( stuffInTheMiddle );
stuffInTheMiddle = " of the story, and not near "
Pat Arb No(pattern)
Description
Constructs a pattern that matches zero or more copies of pattern.
Returns
A pattern.
Argument
pattern
a pattern to match against.
Example
adjectives = "large" | "medium" | "small" | "warm" | "cold" | "hot" | "sweet";
rc = Pat Match( "I would like a medium hot, sweet tea please",
Pat Arbno( adjectives | Pat Any(", ") ) >> adj +
("tea" | "coffee" | "milk") );
Show( rc, adj );
rc = 1;
adj = " medium hot, sweet ";
Pat At(varName)
Description
Constructs a pattern that matches the null string and stores the current position in the source string into the specified JSL variable (varName). The assignment is immediate, and the variable can be used with expr() to affect the remainder of the match.
Returns
A pattern.
Argument
varName
the name of a variable to store the result in.
Example
p = ":" + Pat At( listStart ) + Expr(
If( listStart == 1,
Pat Immediate( Pat Len( 3 ), early ),
Pat Immediate( Pat Len( 2 ), late )
)
);
early = "";
late = "";
Pat Match( ":123456789", p );
Show( early, late );
early = "";
late = "";
Pat Match( " :123456789", p );
Show( early, late );
First this is produced:
early = "123"
late = ""
 
and later this:
early = ""
late = "12"
Pat Break("string")
Description
Constructs a pattern that matches zero or more characters that are not in its argument; it stops or breaks on a character in its argument. It fails if a character in its argument is not found (in particular, it fails to match if it finds the end of the source string without finding a break character).
Returns
A pattern.
Argument
string
a string.
Pat Concat(pattern1, pattern2 <pattern 3, ...>)
Pattern1 + Pattern2 + ...
Description
Constructs a pattern that matches each pattern argument in turn.
Returns
A pattern.
Argument
Two or more patterns.
Pat Conditional(pattern, varName)
Description
Saves the result of the pattern match, if it succeeds, to a variable named as the second argument (varName) after the match is finished.
Returns
A pattern.
Arguments
pattern
a pattern to match against.
varName
the name of a variable to store the result in.
Example
type = "undefined";
rc = Pat Match(
"green apples",
Pat Conditional( "red" | "green", type ) + " apples"
);
Show( rc, type );
rc = 1;
type = "green";
Pat Fail()
Description
Constructs a pattern that fails whenever the matcher attempts to move forward through it. The matcher backs up and tries different alternatives. If and when there are no alternatives left, the match fails and Pat Match returns 0.
Returns
0 when a match fails.
Argument
none
Pat Fence()
Description
Constructs a pattern that succeeds and matches the null string when the matcher moves forward through it, but fails when the matcher tries to back up through it. It is a one-way trap door that can be used to optimize some matches.
Returns
1 when the match succeeds, 0 otherwise.
Argument
none
Pat Immediate(pattern, varName)
Description
Saves the result of the pattern match to a variable named as the second argument (varName) immediately.
Returns
A pattern.
Arguments
pattern
a pattern to match against.
varName
the name of a variable to store the result in.
Example
type = "undefined";
rc = Pat Match(
"green apples",
("red" | "green") >> type + " pears"
);
Show( rc, type );
rc = 0
type = "green"
Even though the match failed, the immediate assignment was made.
Pat Len(int)
Description
Constructs a pattern that matches n characters.
Returns
A pattern.
Argument
int
an integer that specifies the number of characters.
Pat Match(SourceText, Pattern, <ReplacementText>, <NULL>, <ANCHOR>, <MATCHCASE>, <FULLSCAN>)
Description
Pat Match executes the Pattern against the SourceText. The pattern must be constructed first, either inline or by assigning it to a JSL variable elsewhere.
Returns
1 if the pattern is found, 0 otherwise.
Arguments
SourceText
A string or string variable that contains the text to be searched.
Pattern
A pattern or pattern variable that contains the text to be searched for.
ReplacementText
Optional string that defines text to replace the pattern in the source text.
NULL
A placeholder for the third argument if ANCHOR, MATCHCASE, or FULLSCAN are necessary and there is no replacement text.
ANCHOR
Optional command to start the pattern match to the beginning of the string. The following match fails because the pattern, “cream”, is not found at the beginning of the string:
Pat Match( "coffee with cream and sugar", "cream", NULL, ANCHOR );
MATCHCASE
Optional command to consider capitalization in the match. By default, Pat Match() is case insensitive.
FULLSCAN
Optional command to force Pat Match to try all alternatives, which uses more memory as the match expands. By default, Pat Match() does not use FULLSCAN, and makes some assumptions that allow the recursion to stop and the match to succeed.
Pat Not Any("string")
Description
Constructs a pattern that matches a single character that is not in the argument.
Returns
A pattern.
Argument
string
a string.
Pat Pos(int)
Description
Constructs patterns that match the null string if the current position is int from the left end of the string, and fail otherwise.
Returns
A pattern.
Argument
int
an integer that specifies a position in a string.
Pat R Pos(int)
Description
Constructs patterns that match the null string if the current position is int from the right end of the string, and fails otherwise.
Returns
A pattern.
Argument
int
an integer that specifies a position in a string.
Pat R Tab(int)
Description
Constructs a pattern that matches up to position n from the end of the string. It can match 0 or more characters. It fails if it would have to move backwards or beyond the end of the string.
Returns
A pattern.
Argument
int
an integer that specifies a position in a string.
Pat Regex(string)
Description
Constructs a pattern that matches the regular expression in the quoted string argument.
Returns
A pattern.
Argument
string
a string.
Pat Rem()
Description
Constructs a pattern that matches the remainder of the string. It is equivalent to Pat R Tab(0).
Returns
A pattern.
Argument
none
Pat Repeat(pattern, minimum, maximum, GREEDY|RELUCTANT)
Description
Matches pattern between minimum and maximum times.
Returns
A pattern.
Arguments
pattern
a pattern to match against.
minimum
An integer that must be smaller than maximum.
maximum
An integer that must be greater than minimum.
GREEDY|RELUCTANT
If GREEDY is specified, it tries the maximum first and works back to the minimum. If RELUCTANT is specified, it tries the minimum first and works up to the maximum.
Notes
Pat Arbno(p) is the same as Pat Repeat(p, 0, infinity, RELUCTANT)
Pat Repeat(p) is the same as Pat Repeat(p, 1, infinity, GREEDY)
Pat Repeat(p, n) is the same as Pat Repeat(p, n, infinity, GREEDY)
Pat Repeat(p, n, m) is the same as Pat Repeat(p, n, m, GREEDY)
Pat Span("string")
Description
Constructs a pattern that matches one or more (not zero) occurrences of characters in its argument. It is greedy; it always matches the longest possible string. It fails rather than matching zero characters.
Returns
A pattern.
Argument
string
a string.
Pat String("string")
Description
Constructs a pattern that matches its string argument.
Returns
A pattern.
Argument
string
a string.
Pat Succeed()
Description
Constructs a pattern that always succeeds, even when the matcher backs into it. It matches the null string.
Returns
1 when the match succeeds.
Argument
none
Pat Tab(int)
Description
Constructs a pattern that matches forward to position int in the source string. It can match 0 or more characters. It fails if it would have to move backwards or beyond the end of the string.
Returns
A pattern.
Argument
int
an integer that specifies a position in a string.
Pat Test(expr)
Description
Constructs a pattern that succeeds and matches the null string if expr is not zero and fails otherwise.
Returns
A pattern.
Argument
expr
An expression.
Note
Usually the argument is wrapped with expr() because the test needs to be made on the current value of variables set by Pat Immediate, Pat Conditional, and Pat At. Without expr, the test is based on values that were known when the pattern was constructed, which means the test always succeeds or always fails at pattern execution time, which is probably not what you want.
Example
nCats = 0;
whichCat = 3;
string = "catch a catnapping cat in a catsup factory";
rc = Pat Match(
string,
"cat" + Pat Test(
Expr(
nCats = nCats + 1;
nCats == whichCat;
)
),
"dog"
);
Show( rc, string, nCats );
rc = 1
string = "catch a catnapping dog in a catsup factory"
nCats = 3
Regex Match(source, pattern, <MATCHCASE>)
Description
Executes the pattern match in pattern against the quoted source string.
Returns
A pattern.
Argument
source
a string.
pattern
a pattern.
MATCHCASE
Optional. The search is case insensitive unless you specify MATCHCASE.
Comment Functions
// comment
Description
Comments to end of line.
Notes
Everything after the // is ignored when running the script.
/* comment */
Description
A comment that can appear in the middle of a line of script.
Notes
Anything between the beginning tag /* and the end tag */ is ignored when running the script. This comment style can be used almost anywhere, even inside lists of arguments. If you place a comment inside a double-quoted string, the comment is treated merely as part of the string and not a comment. You cannot place comments in the middle of operators.
Examples
+/*comment*/=
:/*comment*/name
are invalid and produce errors. The first comment interrupts += and the second interrupts :name.
sums = {(a+b /*comment*/), /*comment*/ (c^2)}
is valid JSL; the comments are both ignored.
//!
Description
If placed on the first line of a script, this comment line causes the script to be run when opened in JMP without opening into the script editor window.
Notes
You can over-ride this comment when opening the file. Select File > Open. Hold the Ctrl key while you select the JSL file and click Open. Or right-click the file in the Home Window Recent Files list and select Edit Script. The script opens into a script window instead of being executed.
/*debug step*/
/*debug run*/
Description
If placed on the first line of a script, the script is opened into the debugger when it is run.
Notes
All letters must be lower case. There must be one space between debug and step or run, and there must be no other spaces present. Only one of these lines can be used, and it must be the first line of the script; a first line that is blank followed by this comment negates the debug command.
Comparison Functions
The comparison operators (<, <=, >, >=) work for numbers, strings, and matrices. For matrices, they produce a matrix of results. If you compare mixed arguments, such as strings with numbers or matrices, the result is a missing value. Comparisons involving lists are not allowed and also return missing values.
The equality operators (== and !=) work for numbers, strings, matrices, and lists. For matrices, they produce a matrix of results; for lists, they produce a single result. If you test equality of mixed results (for example. strings with numbers or matrices) the result is 0 or unequal.
Range check operators let you check whether something falls between two specified values:
a = 1;
Show( 1 <= a < 3 );
b = 2;
Show( 2 < b <= 3 );
1 <= a < 3 = 1;
2 < b <= 3 = 0;
Expressions with comparison operators are evaluated all at once, not in sequence
All the comparison operators are eliding operators. That means JMP treats arguments joined by comparison operators as one big clause, as opposed to the way most expressions are evaluated one operator at a time. Evaluating as a single clause produces different results than the more usual method of evaluating in pieces. For example, the following two statements are different:
12 < a < 13;
(12 < a) < 13;
The first statement checks whether a is between 12 and 13, because all three arguments and both operators are read and evaluated together. The second statement uses parentheses to regroup the operations explicitly to evaluate from left to right, which would be the normal way to evaluate most expressions. Thus it first checks whether 12 is less than a, returning 1 if true or 0 if false. Then it checks whether the result is less than 13, which is always true because 0 and 1 are both less than 13.
All the comparison operators are elided when they are used in matched pairs or in the unmatched pairs <... <= and <=... <. What this means is that if you want a comparison statement to be evaluated one comparison operator at a time, you should use parentheses ( ) to control the order of operations explicitly.
Equal(a, b, ...)
a==b==...
Description
Compares all the listed values and tests if they are all equal to each other.
Returns
1 (true) if all arguments evaluate to the same value.
0 (false) otherwise.
Arguments
Two or more variables, references, matrices, or numbers.
Notes
If more than two arguments are specified, a 1 is returned only if all arguments are exactly the same. This is typically used in conditional statements and to control loops.
The comparison is case-sensitive for string comparisons.
Greater(a, b, ...)
a>b>...
Description
Compares all the list values and tests if, in each pair, the left value is greater than the right.
Returns
1 (true) if a evaluates strictly greater than b (and b evaluates strictly greater than c, and so on).
0 (false) otherwise.
Arguments
Two or more variables, references, matrices, or numbers.
Notes
If more than two arguments are specified, a 1 is returned only if each argument is greater than the one that follows it. This is typically used in conditional statements and to control loops.
Greater, Less, GreaterOrEqual, and LessOrEqual can also be strung together. If you do not group with parentheses, JMP evaluates each pair left to right. You can also use parentheses to explicitly tell JMP how to evaluate the expression.
Greater or Equal(a, b, ...)
a>=b>=...
Description
Compares all the list values and tests if, in each pair, the left value is greater than or equal to the right.
Returns
1 (true) if a evaluates strictly greater than or equal to b (and b evaluates strictly greater than or equal to c, and so on).
0 (false) otherwise.
Arguments
Two or more variables, references, matrices, or numbers.
Notes
If more than two arguments are specified, a 1 is returned only if each argument is greater than or equal to the one that follows it. This is typically used in conditional statements and to control loops.
Greater, Less, GreaterOrEqual, and LessOrEqual can also be strung together. If you do not group with parentheses, JMP evaluates each pair left to right. You can also use parentheses to explicitly tell JMP how to evaluate the expression.
Is Missing(expr)
Description
Returns 1 if the expression yields a missing value and 0 otherwise.
Less(a, b, ...)
a<b<...
Description
Compares all the list values and tests if, in each pair, the left value is less than the right.
Returns
1 (true) if a evaluates strictly less than b (and b evaluates strictly less than c, and so on).
0 (false) otherwise.
Arguments
Two or more variables, references, matrices, or numbers.
Notes
If more than two arguments are specified, a 1 is returned only if each argument is less than the one that follows it. This is typically used in conditional statements and to control loops.
Greater, Less, GreaterOrEqual, and LessOrEqual can also be strung together. If you do not group with parentheses, JMP evaluates each pair left to right. You can also use parentheses to explicitly tell JMP how to evaluate the expression.
Less LessEqual(a, b, c, ...)
a<b<=c<=...
Description
Range check, exclusive below and inclusive above.
Returns
1 (true) if b is greater than a and less than or equal to c.
0 (false) otherwise.
Arguments
a, b, c
variables, references, matrices, or numbers.
Notes
Returns 1 when two conditions are met: the first argument is less than the second argument, and each remaining argument is less than or equal to its argument on the right. This is typically used in conditional statements and to control loops.
Less or Equal(a, b, ...)
a<=b<=...
Description
Compares all the list values and tests if, in each pair, the left value is less than or equal to the right.
Returns
1 (true) if a evaluates strictly less than or equal to b (and b evaluates strictly less than or equal to c, and so on).
0 (false) otherwise.
Arguments
Two or more variables, references, matrices, or numbers.
Notes
If more than two arguments are specified, a 1 is returned only if each argument is less than or equal to the one that follows it. This is typically used in conditional statements and to control loops.
Greater, Less, GreaterOrEqual, and LessOrEqual can also be strung together. If you do not group with parentheses, JMP evaluates each pair left to right. You can also use parentheses to explicitly tell JMP how to evaluate the expression.
LessEqual Less(a, b, c, ...)
a<=b<c<...
Description
Range check, inclusive below and exclusive above.
Returns
1 (true) if b is greater than or equal to a and less than c.
0 (false) otherwise.
Arguments
a, b, c
variables, references, matrices, or numbers.
Notes
Returns 1 when two conditions are met: the first argument is less than or equal to the second argument, and each remaining argument is less than its argument on the right. This is typically used in conditional statements and to control loops.
Not Equal(a, b)
a!=b
Description
Compares a and b and tests if they are equal.
Returns
0 (false) if a and b evaluate to the same value.
1 (true) otherwise.
Argument
a, b
Any variable or number.
Notes
Mostly used for conditional statements and loop control.
Conditional and Logical Functions
And(a, b)
a&b
Description
Logical And.
Returns
1 (true) if both a and b are true.
0 (false) if either a or b is false or if both a and b are false.
Missing if either a or b is a missing value or if both a and b are missing values.
Arguments
Two or more variables or expressions.
Notes
More than two arguments can be strung together. a&b returns 1 (true) only if all arguments evaluate to true.
AndMZ(a, b)
AndV3(a, b)
a:&b
Description
Logical And with JMP 3 behavior, which treats missing values as 0.
Returns
1 (true) if both a and b are true.
0 (false) if either a or b is false or if both a and b are false.
0 (false) if either a or b is a missing value or if both a and b are missing values.
Arguments
Two or more variables or expressions.
Notes
More than two arguments can be strung together. a:&b returns 1 (true) only if all arguments evaluate to true. When opening a JMP 3 data table, this function is automatically used for any And function.
Break()
Description
Stops execution of a loop completely and continues to the statement following the loop.
Note
Break works with For and While loops, and also with For Each Row.
Choose(expr, r1, r2, r3, ..., rElse)
Description
Evaluates expr. If the value of expr is 1, r1 is returned; if 2, the value of r2 is returned, and so on. If no matches are found, the last argument (rElse) is returned.
Returns
The value whose index in the list of arguments matches expr, or the value of the last argument.
Arguments
expr
an expression or a value.
r1, r2, r3, ...
an expression or a value.
Continue()
Description
Ends the current iteration of a loop and begins the loop at the next iteration.
Note
Continue works with For and While loops, and also with For Each Row.
For(init, while, increment, body)
Description
Repeats the statement(s) in the body as long as the while condition is true. Init and increment control iterations.
Returns
Null.
Arguments
init
Initialization of loop control counter.
while
Condition for loop to continue or end. As long as the conditional statement while is true, the loop is iterated one more time. As soon as while is false, the loop is exited.
increment
Increments (or decrements) the loop counter after while is evaluated every time the loop is executed.
body
Any number of valid JSL expressions, glued together if there are more than one.
Example
mysum = 0; myprod = 1;
For( i = 1, i <= 10, i++, mysum += i; myprod *= i; );
Show( mysum, myprod );
mysum = 55;
myprod = 3628800;
For Each Row(<dt,> script)
Description
Repeats the script on each row of the data table.
Returns
Null.
Argument
dt
Optional positional argument: a reference to a data table. If this argument is not in the form of an assignment, then it is considered a data table expression.
script
Any valid JSL expressions.
Example
The following example creates data table references and then iterates over each row in Big Class.jmp. If the value of age in a row is greater than 15, the age is printed to the log.
dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = Open( "$SAMPLE_DATA/San Francisco Crime.jmp" );
For Each Row( dt1, If( :age > 15, Show( :age ) ) );
If(condition, result, condition, ..., <elseResult>)
Description
Returns result when condition evaluates true. Otherwise returns next result when that condition evaluates as true. The optional elseResult is used if none of the preceding conditions are true. If no elseResult is given, and none of the conditions are true, then nothing happens.
IfMax(expr1, result1, expr2, result2, ... <all missing result>)
Description
Evaluates the first of each pair of arguments and returns the evaluation of the result expression (the second of each pair) associated with the maximum of the expressions. If more than one expression is the maximum, the first maximum is returned. If all expressions are missing and a final result is not specified, missing is returned. If all expressions are missing and a final result is specified, that final result is returned. The test expressions must evaluate to numeric values, but the result expressions can be anything.
Returns
The result expression associated with the maximum of the expressions
IfMin(expr1, result1, expr2, result2, ... <all missing result>)
Description
Evaluates the first of each pair of arguments and returns the evaluation of the result expression (the second of each pair) associated with the minimum of the expressions. If more than one expression is the minimum, the first minimum is returned. If all expressions are missing and a final result is not specified, missing is returned. If all expressions are missing and a final result is specified, that final result is returned. The test expressions must evaluate to numeric values, but the result expressions can be anything.
Returns
The result expression associated with the minimum of the expressions
IfMZ(condition, result, condition, ..., <elseResult>)
IfV3(condition, result, condition, ..., <elseResult>)
Description
Logical If with version 3.x behavior, which treats missing values as 0; used automatically when opening v3 data tables.
Interpolate(x, x1, y1, x2, y2)
Interpolate(x, xmatrix, ymatrix)
Description
Linearly interpolates the y-value corresponding to a given x-value between two points (x1, y1), and (x2, y2) or by matrices xmatrix and ymatrix. The points must be in ascending order.
Is Associative Array(name)
Description
Returns 1 if the evaluated argument is an associative array, or 0 otherwise.
Is Empty(global)
Is Empty(dt)
Is Empty(col)
Description
Returns 1 if the global variable, data table, or data column does not have a value (is uninitialized), or 0 otherwise.
Is Expr(x)
Description
Returns 1 if the evaluated argument is an expression, or 0 otherwise.
Is List
Is Name(x)
Description
Returns 1 if the evaluated argument is a name, or 0 otherwise.
Is Namespace(namespace)
Description
Returns 1 if the namespace argument is a namespace; returns 0 otherwise.
Is Number(x)
Description
Returns 1 if the evaluated argument is a number or missing numeric value, or 0 otherwise.
Is Scriptable(x)
Description
Returns 1 if the evaluated argument is a scriptable object, or 0 otherwise.
Is String(x)
Description
Returns 1 if the evaluated argument is a string, or 0 otherwise.
Match(a, value1, result1, value2, result2, ...)
Description
If a is equal to value1, then result1 is returned. If a is equal to value2, result2 is returned, and so on.
MatchMZ(a, value1, result1, value2, result2, ...)
MatchV3(a, value1, result1, value2, result2, ...)
Description
Match with version 3.x behavior, which treats missing values as 0; used automatically when opening v3 data tables.
Not(a)
!a
Description
Logical Not.
Returns
0 (false) if a>0.
1 (true) if a<=0.
Missing value if a is missing.
Argument
a
Any variable or number. The variable must have a numeric or matrix value.
Notes
Mostly used for conditional statements and loop control.
Or(a, b)
a|b
Description
Logical Or.
Returns
1 (true) if either of or both a and b are true.
0 (false) otherwise.
Missing if either are missing.
Arguments
a, b
Any variable or number.
Notes
Mostly used for conditional statements and loop control.
OrMZ(a, b)
OrV3(a, b)
a :| b
Description
Logical Or with version 3.x behavior, which treats missing values as 0.
Returns
1 (true) if either of or both a and b are true.
0 (false) otherwise.
Arguments
a, b
Any variable or number.
Notes
Mostly used for conditional statements and loop control. When opening a JMP 3 data table, this function is automatically used for any Or function.
Or() returns missing if any evaluated argument is missing. OrMZ() returns 0 if any evaluated argument is missing.
Step(x0, x1, y1, x2, y2, ...)
Step(x0, [x1, x2, ...], [y1, y2, ...])
Description
Returns the y argument corresponding to the largest x argument that is less than or equal to x0. The x points must be specified in ascending order.
Stop()
Description
Immediately stops a script that is running.
While(expr, body)
Description
Repeatedly tests the expr condition and executes the body until the expr condition is no longer true.
Zero Or Missing(expr)
Description
Returns 1 if expr yields a missing value or zero, 0 otherwise.
Constant Functions
JMP provides functions for two useful constant functions.
Note: These functions do not take an argument, but the parentheses are required.
e()
Description
Returns the constant e, which is 2.7182818284590451...
Pi( )
Description
Returns the constant π, which is 3.1415926535897931...
Date and Time Functions
Datetime values are handled internally as numbers of seconds since midnight, January 1, 1904.
The expression x=01Jan1904 sets x to zero, since the indicated date is the base date or “zero date” in JMP. If you examine the values of dates, they should be appropriately large numbers. For example 5oct1998 is 2990390400.
Abbrev Date(date)
Description
Converts the provided date to a string.
Returns
A string representation of the date.
Argument
date
Can be the number of seconds since the base date (midnight, January 1, 1904), or any date-time operator.
Example
Abbrev Date( 29Feb2004 );
02/29/2004
See Also
The Types of Data chapter in the Scripting Guide.
As Date(x)
Description
Formats the number or expression x so that it shows as a date or duration when displayed in a text window. Values that represent one year or more are returned as dates. Values that represent less than a year are returned as durations.
Returns
A date that is calculated from the number or expression provided.
Argument
x
Number or expression.
See Also
The Types of Data chapter in the Scripting Guide.
Date Difference(datetime1, datetime2, "interval_name", <"alignment">)
Description
Returns the difference in intervals of two date-time values.
Returns
A number.
Arguments
datetime1, datetime2
Datetime values.
interval_name
A quoted string that contains a date-time interval, such as "Month", "Day", or "Hour".
alignment
An optional string. Options are as follows:
"start" includes full or partial intervals.
"actual" counts only whole intervals.
"fractional" returns fractional differences using averages for "Year", "Quarter", and "Month" intervals.
Date DMY(day, month, year)
Description
Constructs a date value from the arguments.
Returns
The specified date, expressed as the number of seconds since midnight, 1 January 1904.
Arguments
day
number, day of month, 1-31. Note that there is no error-checking, so you can enter February 31.
month
number of month, 1-12.
year
number of year.
Date Increment(datetime, "interval_name", <increment>, <"alignment">)
Description
Adds 1 or more intervals to a starting datetime value.
Returns
Returns the new datetime value.
Arguments
datetime
The starting datetime value.
interval_name
A quoted string that contains the name of a datetime interval. "Year", "Quarter", "Month", "Week", "Day", "Hour", "Minute", and "Second" are supported.
increment
An optional number that specifies the number of intervals. The default value is 1.
alignment
An optional quoted string that contains a keyword:
"start" truncates the date to the nearest interval prior to adding the increment. For example, it removes the time and outputs the date. "start" is the default value.
"actual" retains the full input datetime value.
"fractional" allows fractional incremental values using averages for the duration of "Year", "Quarter", and "Month" intervals.
Date MDY(month, day, year)
Description
Constructs a date value from the arguments.
Returns
The specified date, expressed as the number of seconds since midnight, 1 January 1904.
Arguments
month
number of month, 1-12.
day
number, day of month, 1-31. Note that there is no error-checking, so you can enter February 31.
year
number of year.
Day(datetime)
Description
Determine the day of the month supplied by the datetime argument.
Returns
Returns an integer representation for the day of the month of the date supplied.
Arguments
datetime
Number of seconds since midnight, 1 January 1904. This can also be an expression.
Example
d1 = Date DMY( 12, 2, 2003 );
3127852800
 
Day( 3127852800 );
12
Day( d1 );
12
Day Of Week(datetime)
Description
Determine the day of the week supplied by the datetime argument.
Returns
Returns an integer representation for the day of the week of the date supplied.
Arguments
datetime
Number of seconds since midnight, 1 January 1904. This can also be an expression.
Day Of Year(datetime)
Description
Determine the day of the year supplied by the datetime argument.
Returns
Returns an integer representation for the day of the year of the date supplied.
Arguments
datetime
Number of seconds since midnight, 1 January 1904. This can also be an expression.
Format(x, "format", <"currency code">, <decimal>)
Format Date(x, "format", <"currency code">, <decimal>)
Description
Converts the value of x into the "format" that you specify in the second argument. Typically used for formatting datetime values from a number of seconds to a formatted date. Format choices are those shown in the data table column properties.
Returns
Returns the converted date in the format specified.
Arguments
x
Can be a column, a number, or a datetime.
format
Any valid format, as a quoted string: "Best", "Fixed Decimal", "Percent", "PValue", "Scientific", "Currency", or any of the Date/Time formats.
currency code
An optional ISO 4217 code for a specific currency (for example, "GBP" for Great Britain, Pound). This argument is valid only if Currency is specified as format.
decimal
An optional integer that specifies the number of decimal places to be shown.
Hour(datetime, <12|24>)
Description
Determines the hour supplied by the datetime argument.
Returns
Returns an integer representation for the hour part of the date-time value supplied.
Arguments
datetime
Number of seconds since midnight, 1 January 1904. This can also be an expression.
12|24
Changes the mode to 12 hours (with am and pm). The default is 24-hour mode.
HP Time()
Description
Returns a high precision time value (in microseconds). This function is only useful relative to another HP Time() value. The time value represents the number of microseconds since the start of the JMP session.
Note
For less precise time values use Tick Seconds().
In Days(n)
Description
Returns the number of seconds per n days. Divide by this function to express seconds as days.
In Format(string, "format")
Parse Date(string, "format")
Description
Parses a string of a given "format" and returns a date/time value. The value is expressed as if surrounded by the As Date() function, returning the date in "ddMonyyyy" format. Format choices are those shown in the data table column properties. See “Utility Functions” for details on As Date.
Example
Informat( "07152000", "MMDDYYYY" );
15Jul2000
In Hours(n)
Description
Returns the number of seconds per n hours. Divide by this function to express seconds as hours.
In Minutes(n)
Description
Returns the number of seconds per n minutes. Divide by this function to express seconds as minutes.
In Weeks(n)
Description
Returns the number of seconds per n weeks. Divide by this function to express seconds as weeks.
In Years(n)
Description
Returns the number of seconds per n years. Divide by this function to express seconds as years.
Long Date(date)
Description
Returns a locale-specific string representation for the date supplied, formatted like "Sunday, February 29, 2004" or "Wednesday, November 9, 2011".
MDYHMS(date)
Description
Returns a string representation for the date supplied, formatted like "2/29/04 00:02:20".
Minute(datetime)
Description
Determines the minute supplied by the datetime argument, 0-59.
Returns
Returns an integer representation for the minute part of the date-time value supplied.
Month(date)
Description
Returns an integer representation for the month of the date supplied.
Parse Date()
Quarter(datetime)
Description
Returns the annual quarter of a datetime value as an integer 1-4.
Second(datetime)
Description
Determines the second supplied by the datetime argument.
Returns
Returns an integer representation for the second part of the date-time value supplied.
Argument
datetime
Number of seconds since midnight, 1 January 1904. This can also be an expression.
Short Date(date)
Description
Returns a string representation for the date supplied, in the format mm/dd/yy. For example, "2/29/04" for the next Leap Day.
Tick Seconds()
Description
Measures the time taken for a script to run, measured down to the 60th of a second.
Note
For higher time value resolution (for example, microseconds) use the HP Time() function.
Time Of Day(datetime)
Description
Returns an integer representation for the time of day of the datetime supplied.
Today()
Description
Returns the current date and time expressed as the number of seconds since midnight, 1 January 1904. No arguments are available, but the parentheses are still necessary.
Week Of Year(date, <rule_n>)
Description
Returns the week of the year that contains a date-time value. Three rules determine when the first week of the year begins.
With rule 1 (the default), weeks start on Sunday, with the first Sunday of the year being week 2. Week 1 is a partial week or empty.
With rule 2, the first Sunday begins with week 1, with previous days being week 0.
With rule 3, the ISO-8601 week number is returned. Weeks start on Monday. Week 1 is the first week of the year with four days in that year. It is possible for the first or last three days of the year to belong to the neighboring year’s week number.
Year(date)
Description
Returns an integer representation for the year of date.
Discrete Probability Functions
Beta Binomial Distribution(k, p, n, delta)
Description
Returns the probability that a beta binomially distributed random variable is less than or equal to k.
Beta Binomial Probability(k, p, n, delta)
Description
Returns the probability that a beta binomially distributed random variable is equal to k.
Beta Binomial Quantile(p, n, delta, cumprob)
Description
Returns the smallest integer quantile for which the cumulative probability of the Beta Binomial(p, n, delta) distribution is larger than or equal to cumprob.
Binomial Distribution(p, n, k)
Description
The probability that a binomially distributed random variable is less than or equal to k.
Returns
The cdf for the binomial distribution with n trials, probability p of success for each trial, and k successes.
Arguments
p
probability of success for each trial
n
number of trials
k
number of successes
Binomial Probability(p, n, k)
Description
The probability that a binomially distributed random variable is equal to k.
Returns
The probability of getting k successes out of n trials if the probability is p.
Arguments
p
probability of success for each trial
n
number of trials
k
number of successes
Binomial Quantile(p, n, cumprob)
Description
The quantile function of binomial distribution.
Returns
The smallest integer quantile for which the cumulative probability of the Binomial(p, n) distribution is larger than or equal to cumprob.
Arguments
p
probability of success for each trial
n
number of trials
cumprob
cumulative probability
Gamma Poisson Distribution(k, lambda, sigma)
Description
Returns the probability that a gamma-Poisson distributed random variable is less than or equal to k.
Arguments
k
The count of interest.
lambda
The mean argument.
sigma
The overdispersion argument.
Gamma Poisson Probability(k, lambda, sigma)
Description
Returns the probability that a gamma-Poisson distributed random variable is equal to k.
Arguments
k
The count of interest.
lambda
The mean argument.
sigma
The overdispersion argument.
Gamma Poisson Quantile(lambda, sigma, cumprob)
Description
Returns the smallest integer quantile for which the cumulative probability of the Gamma Poisson(lambda, sigma) distribution is larger than or equal to cumprob.
Hypergeometric Distribution(N, K, n, x, <r>)
Description
Returns the cumulative distribution function at x for the hypergeometric distribution with population size N, K items in the category of interest, sample size n, count of interest x, and optional odds ratio r.
Hypergeometric Probability(N, k, n, x, <r>)
Description
Returns the probability that a hypergeometrically distributed random variable is equal to x.
Arguments
N
Population size.
k
The Number of items in the category of interest.
n
Sample size.
x
Count of interest.
r
Optional odds ratio.
Neg Binomial Distribution(p, n, k)
Description
Returns the probability that a negative binomially distributed random variable is less than or equal to k, where the probability of success is p and the number of successes is n.
Neg Binomial Probability(p, n, k)
Description
Returns the probability that a negative binomially distributed random variable is equal to k, where the probability of success is p and the number of successes is n.
Poisson Distribution(lambda, k)
Description
Returns the cumulative distribution function at k for the Poisson distribution with mean lambda.
Poisson Probability(lambda, k)
Description
Returns the probability that a Poisson distributed random variable with mean lambda is equal to k.
Poisson Quantile(lambda, cumprob)
Description
Returns the smallest integer quantile for which the cumulative probability of the Poisson(lambda) distribution is larger than or equal to cumprob.
Display Functions
Alpha Shape(Triangulation)
Description
Returns the alpha shape for the given triangulation.
Border Box(<Left(pix)>, <Right(pix)>, <Top(Pix)>, <Bottom(Pix)>, <Sides(0)>, db)
Description
Constructs a bordered display box that contains another display box. Optional arguments (Left, Right, Top, Bottom) add space between the border box and what it contains. The other optional argument (Sides) draws borders around the border box on any single side or combination of sides; draws the border in black or the highlight color; makes the background transparent or white or erases the background of a display box that contains it.
Returns
The display box.
Arguments
Left
An integer that measures pixels.
Right
An integer that measures pixels.
Top
An integer that measures pixels.
Bottom
An integer that measures pixels.
Sides
An integer that maps to settings for the display box.
db
a display box object (for example, a text box or another border box).
Notes
The formula for deriving the integer for Sides is: 1*top + 2*left + 4*bottom + 8*right + 16*highlightcolor + 32*whitebackground + 64*erase. Thus, if you want to just draw a black border on the top and bottom, 1+4 = 5. If you want that same box with a white background, 5+32 = 37.
Button Box("title", <<Set Icon("path"), "script" <<Set Icon Location("left, "right")
Description
Constructs a button with the text title that executes script when clicked.
Returns
The display box (button box).
Arguments
title
A quoted string or a string variable.
script
A quoted string or a reference to a string where the string is a valid JSL script.
<<Set Icon("path")
Displays the image in the pathname on the button. Most common graphic formats are supported, such as GIF, JPG, PNG, BMP, TIF. Since the title argument is optional, you can create a button with only a text title, with only an icon, or with both a text title and an icon. In the last case, the icon is placed next to the text title.
<<Set Icon Location("right" or "left")
Allows the position of the icon on a button to be either left or right of the text.
Notes
Line-break characters are ignored in button boxes.
Calendar Box("title", < <<Date, <<Min Date, <<Max Date, <<Show Time>)
Description
Constructs a pop-up calendar with selectable days and time.
Returns
The display box (calendar box).
Arguments
title
A quoted string or a string variable.
<<Date
The currently selected date.
<<Min Date
The earliest date that can be selected.
<<Max Date
The latest date that can be selected.
<<Show Time
The time that can be specified.
Example
The following example creates a calendar with October 5, 1989 initially selected. The minimum date and maximum date are specified, so the user can select only dates in that range.
New Window( "Calendar Box Example", cal = Calendar Box() );
date = Date MDY (10, 5, 1989);
cal << Date( date );
cal << Show Time( 0 ); // omit the time
 
cal << Min Date( Date Increment(date, "Day", -60, "start" ) );
// earliest date that can be selected is 60 days before 10/5/1989
// "start" truncates the value so the time is not included
 
cal << Max Date( Date Increment(date, "Day", 60, "start" ) );
// latest date that can be selected is 60 days after 10/5/1989
 
cal << Set Function( Function( {this}, Print( Abbrev Date(this << Get Date()) ) ) );
// print the abbreviated date to the log
Check Box(list, <script>)
Description
Constructs a display box to show one or more check boxes.
Returns
The display box (Check Box).
Arguments
list
a list of quoted strings or a reference to a list of strings.
script
an optional JSL script.
Messages
<<Get(n)
Returns 1 if the check box item specified by n is selected, or 0 otherwise.
<<Set(n, 0|1)
Sets the check box item specified by n as either selected (1) or cleared (0).
<<Get Selected
Returns a list of strings that contain the names of the check box items that are selected.
<<Enable Item(n, 0|1)
Sets the check box item specified by n as either enabled (1) or disabled (0). The state of a disabled check box cannot be changed.
<<Item Enabled(check box item)
Returns 0 or 1 depending on whether the specific check box item is enabled.
Example
Create three check boxes labeled “one”, “two”, and “three”. The first check box is selected.
New Window( "Example", Check Box( {"one", "two", "three"}, <<Set( 1, 1 ) ) );
Col List Box(<"all"|"character"|"numeric">, <width(pixels)>, <maxSelected(n)>, <nlines(n)>, <MaxItems(n)>, <MinItems(n)>, <On Change(expr)>,<script>)
Description
Constructs a display box to show a list box that allows selection of data table columns.
Returns
The display box (ColListBox).
Arguments
all | character | numeric
an optional command that adds all columns of the current data table into the list. Omitting "all" results in an empty collistbox with the “optional” label. To display “optional character”, specify "character". To display “optional numeric”, specify "numeric".
width(pixels)
an optional command that sets the width of the list box to pixels. Pixels is a number that measures pixels.
maxSelected(n)
an optional command that sets whether only one item can be selected. For n>1, n is ignored.
nlines(n)
an optional command that sets the length of the list box to n number of lines. n is an integer.
script
an optional script.
MaxItems(n)
An optional number that only allows n columns to be added to the list.
MinItems(n)
An optional number that only requires at least n columns for the list. If n=2, the top two slots in the Col List Box an initial display of “required numeric” (or whatever you set the data type to be).
On Change(expression)
An optional command that evaluates the expression each time the contents of the column list box changes. Dragging between two column list boxes that have this argument results in both expressions being evaluated. The expression for the target being dragged is evaluated first, then the expression for the source is evaluated.
Messages
Set Tips ( {"Tip text 1", "Tip text 2", ...} )
Sets tool tips for items in the list box. A null string or an empty list results in no tips. A list shorter that the list of items in the list box will use the last tip text for the remaining items in the list and the list box.
Set Tip ( "Tip text" )
Overrides any tool tips set using Set Tips() function. If there is a tip set for the box, you cannot set tips for each individual item.
Using Set Tip() with no arguments clears the list box tip and allows the individual item tool tips to be displayed.
Note
The maxSelected argument only affects whether one or more than one item can be selected. It does not enforce a limit greater than 1.
Column Dialog(ColList("rolename"), specifications)
Description
Draws a dialog box for column role assignments.
Returns
A list of commands that were sent and the button that was clicked.
Arguments
ColList
Specifies the name of at list one list to add variables to.
specifications
Any additional Dialog items (for example, Max Col, Datatype).
Combo Box(list, <script>)
Description
Constructs a display box to show a combo box with a menu.
Returns
The display box (ComboBox).
Arguments
list
a list of quoted strings or a reference to a list of strings.
script
an optional JSL script.
Context Box(displayBox, ...)
Description
Defines a scoped evaluation context. Each Context Box is executed independently of each other.
Returns
A display box.
Arguments
Any number of display boxes.
Current Journal()
Description
Gets the display box at the top of the current (topmost) journal.
Returns
Returns a reference to the display box at the top of the current journal.
Current Report()
Description
Gets the display box at the top of the current (topmost) report window.
Returns
Returns a reference to the display box at the top of the current report window.
Current Window()
Description
Returns a reference to the current window.
Dialog(contents)
Dialog is deprecated. Use New Window() with the Modal argument instead. See the Display Trees chapter in the Scripting Guide for details.
Excerpt Box(report, subscripts)
Description
Returns a display box containing the excerpt designated by the report held at number report and the list of display subscripts subscripts. The subscripts reflect the current state of the report, after previous excerpts have been removed.
Expr As Picture(expr(...), <width(pixels)>)
Description
Converts expr() to a picture as it would appear in the Formula Editor.
Returns
Reference to the picture.
Argument
expr(...)
Place any valid JSL expression that can be displayed as a picture inside expr().
width(pixels)
an optional command that sets the width of the box to pix. pix is a number that measures pixels.
Filter Col Selector(<data table(name)>, <width(pixels)>, <Nlines(n)>, <script>, <OnChange(expr)>)
Description
Returns a display box that contains a list of items. Control allows column filtering.
Global Box(global)
Description
Constructs a box for editing global value directly.
Graph()
Graph 3D Box(properties)
Description
Constructs a display box with 3-D content.
Returns
The display box.
Arguments
Properties can include: framesize(x, y), Xname("title"), Yname("title"), Zname("title").
Note
This display box constructor is experimental.
Graph Box(properties, script)
Graph(properties, script)
Description
Constructs a graph with axes.
Returns
The display box (Graph Box).
Arguments
properties
Named property arguments: title("title"), XScale(low, high), YScale(low, high), FrameSize(h, v), XName("x"), YName("y"), SuppressAxes.
script
Any script to be run on the graph box.
H Center Box(display box)
Description
Returns a display box with the display box argument centered horizontally with respect to all other sibling display boxes.
H List Box(<Align("center"|"bottom")>, display box, <arguments>)
Description
Creates a display box that contains other display boxes and displays them horizontally.
Arguments
Align
Specify bottom or center alignment of the contents in the list box. The contents are bottom aligned by default.
display box
Any number of display box arguments can be contained in the list box.
H Sheet Box(<<Hold(report), display boxes)
Description
Returns a display box that arranges the display boxes provided by the arguments in a horizontal layout. The <<Hold() message tells the sheet to own the report(s) that is excerpted.
H Splitter Box(<size(h,v)>, display box, <arguments>)
Description
Returns a display box that arranges the display boxes provided by the arguments in a horizontal layout (or panel). The splitter enables the user to interactively resize the panel.
Arguments
display box
Any number of display box arguments can be contained in the splitter box.
Optional Arguments
size(h,v)
Specifies the size of the splitter box in pixels. This size is for the outer splitter box. Inner display boxes are proportionately sized according to the width and height of the outer splitter box.
<<Size(n)
Specifies the proportions of the last panel. <<Size(.25) resizes the last panel to 25% the splitter box height (or width, for vertical splitter boxes).
<<Set Sizes({n,n})
Specifies the proportions of each panel. db<<Set Sizes({.75, .25}) sizes the first panel to 75% and the second panel to 25% of the splitter box height (or width, for vertical splitter boxes).
<<Close Panel(n, <Boolean>)
Closes the panel that you specify. <<Close Panel(2) closes the second panel. With three or more panels, you must include the second Boolean value. That value indicates which panel expands to fill the space left by the closed panel.
<<Close Panel(2,0) closes the second panel; the following sibling takes the extra space.
<<Close Panel(2,1) closes the second panel; the preceding sibling takes the extra space.
<<Open Panel(n, <Boolean>)
Opens the panel that you specify. With three or more panels, you must include the second Boolean value. Works similar to <<Close Panel described above. The panels are initially opened. You use <<Open Panel only after using <<Close Panel.
<<Get Sizes()
Returns the proportions of each panel as a list.
Hier Box("text", Hier Box(...), ...)
Description
Constructs a node of a tree (similar to Diagram output) containing text. Hier Box can contain additional Hier Boxes, allowing you to create a tree. The text can be a Text Edit Box.
Icon Box("name")
Description
Constructs a display box containing an icon, where the argument is a name such as Popup Image shown here, Locked Image shown here, Labeled Image shown here, Sub Image shown here, Excluded Image shown here, Hidden Image shown here, Continuous Image shown here, Nominal Image shown here, or Ordinal Image shown here. The argument can also be a path to an image.
Argument
name
Quoted string that is the name of a JMP icon or the path to an icon.
Example
Icon Box( "Nominal" ) constructs a display box that contains the Nominal icon.
Icon Box( "$SAMPLE_IMAGES/pi.gif" ) inserts the pi.gif sample image.
If Box(Boolean, display boxes)
Description
Constructs a display box whose contents are conditionally displayed.
Arguments
Boolean
1 displays the display boxes inside the If Box; if 0, does not display them.
display boxes
Any display box tree.
Journal Box("Journal Text")
Description
Constructs a display box that displays the quoted string journal box. We recommend that you do not generate the journal text by hand.
Line Seg(x, y, <Row States(dt | dt, [rows] | dt, {{rows}, ...} | {states} ) >, <Sizes(s)>)>)
Description
Creates a display seg of connected line segments. The optional third argument enables row state assignments from either a data table or independently.
Lineup Box(<NCol(n)>, <Spacing(pixels, <vspace>), display boxes, ...)
Description
Constructs a display box to show an alignment of boxes in n columns.
List Box({"item", ...}, <width(pixels)>, <maxSelected(n)>, <nLines(n)>, <script>)
Description
Creates a display box to show a list box of selection items. The argument can be a list of two-item lists containing the item name and a string that specifies the modeling type or sorting order. Item names are case sensitive by default. The icon appears next to the corresponding item in the list box.
Marker Seg(x, y, <Row States(dt | dt, [rows] | dt, {{rows}, ...}| {states} ) >, <Sizes(s)>)
Description
Creates a display seg with markers for all of the x and y values. The optional third argument enables row state assignments from either a data table or independently.
Matrix Box(matrix)
Description
Displays the matrix given in the usual array form.
Mouse Box(displayBoxArgs, messages)
Description
Returns a box that can make JSL callbacks for dragging and dropping, marking, or clicking and tracking mouse actions.
Arguments
displayBoxArgs
Specifies the object that the user interacts with, such as a Text Box or Button Box. See the Scripting Index in the Help menu for details.
New Image()
New Image(width, height)
New Image("filepath")
New Image(picture)
New Image(matrix)
New Image("rgb"|"r"|"rgba", {matrix, ...})
Description
Creates a new image in a report. PNG, JPG, GIF, BMP, or TIF file types are supported.
Returns
An image.
Arguments
All argument sets are optional, but all arguments within each set are required.
width, height
Sets the width and height of the image in pixels.
"filepath"
A filepath to an image.
picture
A JSL picture object.
matrix
The image as a matrix of JSL color pixels.
"rgb"|"r"|"rgba", {matrix, ...}
Specify the channels (rgb, r, or rgba) and provide a matrix of values (0.0-1.0) for each channel. Examples:
New Image( "r", [r matrix] );
New Image( "rgb", {[r matrix], [g matrix], [b matrix]} );
New Image( "rgba", {[r matrix], [g matrix], [b matrix], [a matrix]} );
New Window("title", <arguments>, displayBox)
Description
Makes a new window with the indicated title (a required argument) and a display box tree.
Additional Arguments
<<Script(<"script">)
Creates a new script window. The optional quoted string script is placed inside the script window.
<<Journal
Creates an empty journal.
<<Modal
Makes the new window a modal window, which prevents any other actions in JMP until the window is closed. If you do not include an OK or Cancel button, one is added automatically for you. Note: If used, this argument must be the second argument, directly after the window title. Available modal window arguments are:
<<On Open(expr) runs expr when the window is created.
Note: In data tables, On Open (or OnOpen) scripts that execute other programs are never run. Set the Evaluate OnOpen Scripts preference to control when the script is run.
<<On Close (expr) runs expr when the window is closed. Returns 0 if the window fails to close.
<<On Validate (expr) runs expr when the OK button is pressed. If it returns True, the window is closed otherwise the window remains open.
<<Return Result changes the window’s return value when it closes to match that of the deprecated Dialog() function.
Show Toolbars(0|1)
Show or hide the toolbar. The default value is 1. (Windows only.)
Show Menu(0|1)
Show or hide the menu bar. The default value is 1. (Windows only.)
Suppress AutoHide
Suppress or use the auto-hide feature for menus and toolbars. The default value is 1. (Windows only).
Notes
Dialog() was deprecated in JMP 10. Use New Window() with the Modal argument instead. See the Display Trees chapter in the Scripting Guide for details about using New Window().
Number Col Box("title", numbers)
Description
Creates a column named title with numeric entries given in list or matrix form.
Number Col Edit Box("title", numbers)
Description
Creates a column named title with numeric entries given in list or matrix form. The numbers can be edited.
Number Edit Box(value)
Description
Creates an editable number box that initially contains the value argument.
Returns
The display box object.
Argument
value
Any number.
Outline Box("title", display box, ...)
Description
Creates a new outline named title containing the listed display boxes.
Page Break Box()
Description
Creates a display box that forces a page break when the window is printed.
Panel Box("title", display box)
Description
Creates a display box labeled with the quoted string title that contains the listed display boxes.
Picture Box(Open(picture), format)
Description
Creates a display box that contains a graphics picture object.
Returns
A reference to the display box.
Argument
Open
Opens the directory that contains the picture.
picture
The pathname for the picture to include.
format
The graphic file format.
Example
New Window( "Example",
Picture Box( Open( "$SAMPLE_IMAGES/pi.gif", gif ) ) );
Plot Col Box("title", numbers)
Description
Returns a display box labeled with the quoted string title to graph the numbers. The numbers can be either a list or a matrix.
Popup Box({"command1", script1, "command2", script2, ...})
Description
Creates a red triangle menu. The single argument is an expression yielding a list of an even number of items alternating between the command string and the expression that you want evaluated when the command is selected. If the command is an empty string, a separator line is inserted. Note: Pressing ALT and right-clicking the red triangle menu opens a window with check boxes for the commands. See the JMP Reports chapter in the Using JMP book for details.
Radio Box({"item", ...}, <script>)
Description
Constructs a display box to show a set of radio buttons. The optional script is run every time a radio button is selected.
Range Slider Box(minValue, maxValue, lowVariable, highVariable, script)
Description
Range Slider Box() returns a display box that shows a range slider control that ranges from minValue to maxValue. As the two sliders' positions change, their values are placed into lowVariable and highVariable, and the script is run.
Returns
The display box (RangeSliderBox).
Arguments
minValue, maxValue
Numbers that set the minimum and maximum value the slider represents.
lowVariable
The variable whose value is set and changed by the lower slider.
highVariable
The variable whose value is set and changed by the upper slider.
script
Any valid JSL commands that are run as the slider is moved.
Report(obj)
Description
Returns the display tree of a platform obj. This can also be sent as a message to a platform:
obj<<Report
Scene Box(x size, y size)
Description
Creates an x by y-sized scene box for 3-D graphics.
Script Box(<"script">, <width>, <height>)
Description
Constructs an editable box that contains the quoted string script. The editable box is a script window and can both be edited and run as JSL.
Arguments
script
An optional quoted string that appears in the script box.
width
An optional integer that sets the width of the script box.
height
An optional integer that sets the height of the script box.
Scroll Box(<size(h,v)>, <flexible(Boolean)>, display box, ...)
Description
Creates a display box that positions a larger child box using scroll bars.
Returns
A reference to the scroll box object.
Arguments
size(h,v)
Optional. The h and v arguments specify the size of the box in pixels.
flexible(Boolean)
Optional. True (1) sets the box to be resizable with the window. False (0) sets the box to remain the same size when the window is resized.
display box
Any number of display box arguments can be contained in the scroll box.
Note
You can send a scroll box object a message to set the background color:
<<Set Background Color( {R, G, B} | <color> )
You can set the Boolean flags for horizontal (h) and vertical (v) scrolling to enable (1) or disable (0) the scroll bars. If scrolling is disabled in a given direction, the Scroll Box will behave as a regular container in that direction.
<<Set Scrollers (h, v)
To return the flags for scrolling, use the following message:
<<Get Scrollers
To set the horizontal (h) and vertical (v) positions (in pixels) for the scrollers on the scroll bar:
<<Set Scroll Position (h,v)
To return the flags for scroll position, use the following message:
<<Get Scroll Position
To return the maximum positions for horizontal and vertical scrolling, use the following message:
<<Get Scroll Extents
Example
The following example shows a window containing a scroll box with the specified settings.
win = New Window( "Example",
sb = Scroll Box(
Size( 150, 75 ),
List Box(
{"First Item", "Second Item",
"Third Item", "Fourth Item",
"Fifth Item"},
width( 200 ),
max selected( 2 ),
nlines( 6 )
)
)
);
win << Set Window Size( 300, 200 );
sb << Set Scrollers( 1, 1 ); // enable both scroll bars
sb << Set Scroll Position( 0, 20 ); // position the scrollers on the scroll bar
Sheet Part("title", display box)
Description
Returns a display box containing the display box argument with the quoted string title as its title.
Slider Box(minValue, maxValue, variable, script, <set width(n)>, <rescale slider(min, max)>)
Description
Creates an interactive slider control.
Returns
The display box (SliderBox).
Arguments
minValue, maxValue
Numbers that set the minimum and maximum value the slider represents.
variable
the variable whose value is set and changed by the slider box.
script
Any valid JSL commands that is run as the slider box is moved.
set width(n)
specify the width of the slider box in pixels.
rescale slider(l, u)
resets the max and min values for the slider box.
Notes
You can send Set Width and Rescale Slider as commands to a slider object. For example:
ex = .6;
New Window( "Example", mybox = Slider Box( 0, 1, ex, Show( ex ) ) );
mybox << Set Width( 200 ) << Rescale Slider( 0, 5 );
Spacer Box(<size(h,v)>, <color(color)>)
Description
Creates a display box that can be used to maintain space between other display boxes, or to fill a cell in a LineUp Box.
Returns
A reference to the display box.
Arguments
size(h,v)
Optional. The h and v arguments specify the size of the box in pixels.
color(color)
Optional. Sets the color of the box to the JSL color argument.
String Col Box("title", {"string", ...})
Description
Creates column in the table containing the string items listed.
String Col Edit Box("title", {"string", ...})
Description
Creates column in the table containing the string items listed. The string boxes are editable.
Note
To retrieve the data, use this message:
data = obj << Get;
Tab Box(Tab Page Box("page title 1", <options>, contents of page 1), Tab Page Box("page title 2", <options>, contents of page 2), ...);
Description
(Previously called Tab List Box). Creates a tabbed window pane. The arguments are an even number of items alternating between the name of a tab page and the contents of the tab page.
Note
Certain messages you can send to Tab Page Box have been renamed, as follows:
Set Title to Title
Set Tip to Tip
Set Icon to Icon
Set Closeable to Closeable
Example
New Window( "Example",
Tab Box(
t1 = Tab Page Box( "alpha", Panel Box( "panel", Text Box( "text" ) ) ),
t2 = Tab Page Box( "beta", Popup Box( {"x", ex = 1, "y", ex = 2} ) ),
)
);
Table Box(display box, ...)
Description
Creates a report table with the display boxes listed as columns.
Text Box("text", <arguments>)
Description
Constructs a box that contains the quoted string text.
Arguments
<<Justify Text("position")
Justifies the text left, center, or right as specified in quotes.
<<Set Wrap(pixels)
Sets the point at which text wraps.
Text Edit Box("text", <arguments>)
Description
Constructs an editable box that contains the quoted string text.
Arguments
<<Password Style(boolean)
Displays asterisks in the box rather than the password.
<<Set Script
Runs the specified script after the text is edited.
<<Set Width(pixesl)
Sets the point at which text wraps.
Tree Box(<{rootnodes}>, <size(width, height)>, <MultiSelect>)
Description
Constructs a box to show a hierarchical tree composed of Tree Nodes.
Arguments
{rootnodes}
Specifies the names for the root nodes created by Tree Node() which the box contains.
size(width, height)
Specifies the width and height (in pixels) of the box.
MultiSelect
Indicates that more than one item in the tree can be selected.
Tree Node(<data>)
Description
Creates a node for display in a Tree Box display. Tree Node is used for both parent and child nodes.
Triangulation(<dt>, X(col1, col1), <Y(Col)>)
Description
Returns an object containing the Delaunay triangulation of the given point set. The optional Y will be averaged for duplicate points, and all points in the output will be unique.
Examples
tri = Triangulation(
X( [0 0 1 1], [0 1 0 1] ),
Y( [0 1 2 3] )
);
dt = Open( "$SAMPLE_DATA/Cities.jmp" );
tri = Triangulation( X( :X, :Y ), Y( :POP ) );
V Center Box(display box)
Description
Returns a display box with the display box argument centered vertically with respect to all other sibling display boxes.
V List Box(<Align("center"|"right")> display box, ...)
Description
Creates a display box that contains other display boxes and displays them vertically.
Arguments
Align
Specify right or center alignment of the contents in the list box. The contents are center aligned by default.
display box
Any number of display box arguments can be contained in the list box.
V Sheet Box(<<Hold(report), display boxes)
Description
Returns a display box that arranges the display boxes provided by the arguments in a vertical layout. The <<Hold() message tells the sheet to own the report(s) that is excerpted.
V Splitter Box(<size(h,v)>, display box, <arguments>)
Description
Returns a display box that arranges the display boxes provided by the arguments in a vertical layout (or panel). The splitter enables the user to interactively resize the panel.
Arguments
display box
Any number of display box arguments can be contained in the splitter box.
Notes
For details about the optional arguments, see “H Splitter Box(<size(h,v)>, display box, <arguments>)”.
Web Browser Box("url")
Description
Creates a display box that contains a web page. Available only on Windows.
Returns
A reference to the web browser box object.
Argument
url
A quoted string containing the URL to the web page to display.
Example
The following example creates a splitter box with the web browser box on the left and the bubble plot on the right.
dt = Open( "$SAMPLE_DATA/PopAgeGroup.jmp" );
New Window( "Example",
H Splitter Box(
Size( 800, 300 ),
wb = Web Browser Box( "http://www.jmp.com" ),
dt << Run Script( "Bubble Plot Region" )
)
);
wb << Set Auto Stretching( 1, 1 ); // auto stretch horizontally and vertically
wb << Set Max Size( 10000, 10000 ); // maximum size in pixels
Window(<string|int>)
Returns
Either a list of references to all open windows, or a reference to an explicitly named window.
Arguments
string
A quoted string containing the name of a specific open window.
int
the number of a specific open window.
Notes
If no argument is provided, a list of all open windows is returned.
If the argument (either a window name or number) does not exist, an empty list is returned.
Wrap List Box( display box, ...)
Description
Creates a list box that contains other display boxes and displays them horizontally, but wraps them when printing.
Arguments
display box
Any number of display box arguments can be contained in the list box.
Expression Functions
Arg(expr, i)
Arg Expr(expr, i)
Description
Finds the argument numbered by i within the given expression.
Returns
The ith argument within the expression expr.
Empty() if that argument does not exist or is not specified.
Arguments
expr
an expression defined previously in the JSL script.
i
an integer denoting which argument to return.
Notes
Arg Expr() was deprecated in a previous release of JMP. Use Arg() instead.
Eval Expr(expr)
Description
Evaluates any expressions within expr, but leaves the outer expression unevaluated.
Returns
An expression with all the expressions inside expr evaluated.
Argument
expr
Any JSL expression.
Expr(x)
Description
Returns the argument unevaluated (expression-quoting).
Returns
The argument, unevaluated.
Argument
x
Any valid JSL expression.
Extract Expr(expr, pattern)
Description
Find expr matching pattern.
Returns
A pattern that matches the specified pattern.
Arguments
expr
Any expression.
pattern
Any pattern.
Head(exprArg)
Head Expr(exprArg)
Description
Returns the head of the evaluated expression, without its arguments.
Note
Head Expr() is deprecated. Use Head() instead.
Head Name(expr)
Head Name Expr(expr)
Description
Returns the head of the evaluated expression as a string.
Note
Head Name Expr() is deprecated. Use Head Name() instead.
Integrate(expr, varname, lowLimit, upLimit, <<Tolerance(1e-10), <<StoreInfo(list), <<StartingValue(val))
Description
Integrates an expression with respect to a scalar value, using the adaptive quadrature method from Gander and Gautschi (2000).
Arguments
expr an expression that defines the integrand.
varname the name of the variable of integration. If this variable contains a value, that value specifies a starting value that is used as a typical value to improve the accuracy of the integral.
lowLimit specifies the lower limit of integration. To specify negative infinity as the lower limit of integration, set this to missing.
upLimit specifies the upper limit of integration. To specify positive infinity as the upper limit of integration, set this to missing.
StoreInfo saves diagnostics of the numerical integration routine to the argument of StoreInfo().
StartingValue specifies a starting value that is used as a typical value to improve the accuracy of the integral.
N Arg(exprArg)
Description
Returns the number of arguments of the evaluated expression head.
N Arg Expr(exprArg)
Description
Returns the number of arguments of the expression head.
Name Expr(x)
Description
Returns the unevaluated expression of x rather than the evaluation of x.
File Functions
Close(<dt|query>, <nosave|save("path")>)
Description
Closes a data table, query, or JSON file. If no arguments are specified, the current file is closed. If the file has been changed, it is automatically saved. All dependent windows are also closed (for example, report windows that are based on the data table).
Returns
Void.
Arguments
dt
an optional reference to a data table, query, or JSON file.
nosave|save("path")
An optional switch to either save the file to the specified path before closing or to close the file without saving it.
Close All(type, <invisible|private>, <noSave|save>)
Description
Closes all open resources of type.
Argument
type
A named argument that defines the type of resources that you want to close. The allowable types are: Data Tables, Reports, and Journals.
invisible
Optional. Specifies whether to close all invisible data tables.
private
Optional. Specifies whether to close all private data tables.
noSave or Save
An optional argument that specifies whether to save the specified types of windows before closing or to close without saving.
Close Log(Boolean)
Description
Closes the log window.
Convert File Path(path, <"absolute"|"relative">, <"posix"|"windows">, <base(path)>)
Description
Converts a file path according to the arguments.
Returns
The converted path.
Arguments
path
A pathname that can be either Windows or POSIX.
absolute|relative
Optional quoted string, specifies whether the returned pathname is in absolute or relative terms. The default value is absolute.
posix|windows
Optional quoted string, specifies whether the returned pathname is in Windows or POSIX style. The default is POSIX.
base(path)
Optional, specifies the base pathname, useful if relative is specified. The default is the default directory.
Copy Directory("from path", "to path", <recursive=Boolean>)
Description
Copies files from one directory to another, optionally copying subdirectories. The directory name is created in the to path and should not be part of the to path argument.
Returns
Returns 1 if the directory is copied; otherwise, returns 0.
Arguments
from path
Specifies the directory containing the files to copy to the new directory.
to path
Specifies the path where the new directory should be created and to which the files are copied.
<recursive(Boolean)>
Indicates whether to copy the from path subdirectory structure to the to path.
Copy File("from path", "to path")
Description
Copies one file to a new file using the same or a different name.
Returns
Returns 1 if the file is copied; otherwise, returns 0.
Arguments
from path
Specifies the path and file name to copy to the new file.
to path
Specifies the path and file name for the new file.
Create Database Connection( (string, <DriverPrompt(1)>) | "Connect Dialog");
Description
Creates a connection to the specified database or prompts the user to provide database log in information.
Returns
A handle to the database connection.
Arguments
string
The server connection string that contains information such as the data source name and user name.
Driver Prompt
An optional Boolean argument that enables the ODBC driver to prompt for the connection information if necessary.
"Connect Dialog"
A string that opens the Select Data Source window, from which the user selects the database.
Examples
Specify the data source name, user name, and password:
Create Database Connection( "dsn=Books;UID=johnsmith;password=Christmas" );
Request that the ODBC driver prompt the user to enter connection information, because the connection string does not specify the password:
Create Database Connection( "dsn=Books;UID=johnsmith", Driver Prompt( 1 ) );
Enable the user to select the data source, specify "Connect Dialog":
Create Database Connection( "Connect Dialog" );
Create Directory("path")
Description
Creates a new directory at the specified path location.
Returns
Returns 1 if the directory is created; otherwise, returns 0.
Arguments
path
Specifies the path where the new directory should be located.
Creation Date("path")
Description
Returns the creation date for the specified file or directory.
Returns
Creation date.
Arguments
path
Specifies the directory or path and file name for the query.
Delete Directory("path")
Description
Deletes the specified directory and its contents and any subdirectories.
Returns
Returns 1 if the directory is deleted; otherwise, returns 0.
Arguments
path
Specifies the path and directory for deletion.
Delete File("path")
Description
Deletes the specified file.
Returns
Returns 1 if the file is deleted; otherwise, returns 0.
Arguments
path
Specifies the path and file name for deletion.
Directory Exists("path")
Description
Verifies the specified directory exists.
Returns
Returns 1 if the directory exists; otherwise returns 0.
Arguments
path
Specifies the path and directory for verification.
File Exists("path")
Description
Verifies the specified file name exists at the specified path.
Returns
Returns 1 if the file exists; otherwise returns 0.
Arguments
path
Specifies the path and file name for verification.
Files In Directory(path, <"recursive">)
Description
Returns a list of filenames in the path given.
Returns
List of filenames. If "recursive" is not specified, directory names are included in the list.
Arguments
path
A valid pathname.
recursive
An optional quoted keyword that causes all folders in the path (and all folders that they contain, and so on) to be searched for files.
Get Current Directory()
Description
Retrieves the current directory, which is used in the Open File window. Note: The operating system can change the current directory outside of JMP. The function is deprecated. On Macintosh and Windows, the initial current directory is the user’s Documents folder. Previously, Windows returned the folder that contained jmp.exe or the working folder set by the operating system when JMP is launched.
If JMP was opened using the JMP shortcut, the function returns the JMP Installation directory. For example, on Windows, the current directory is "/C:/Program Files/SAS/JMPPRO/13/" or "/C:/Program Files/SAS/JMP/13/".
If JMP was opened by double-clicking a JMP file (.jmp, .jsl, .jrn, and so on), the command returns the path of the opened file.
If the current directory was configured using the Set Current Directory() function, JMP returns the specified path.
Returns
The absolute pathname as a string.
Arguments
none
Get Default Directory()
Description
Retrieves the user’s default directory. This path is used for subsequent relative paths.
If the default directory was set using Set Default Directory(), JMP returns the specified path as long as Get Default Directory() and Set Default Directory() are in the same script.
Returns
The absolute pathname as a string.
Arguments
none
Get Excel Worksheets("absolute path")
Description
Retrieves a list of worksheets that are in the specified Microsoft Excel workbook. If no worksheets are found, an empty list is returned.
Notes
The function supports .xlsx and Excel 1997 or later workbooks.
Get File Search Path()
Description
Retrieves the current list of directories to search for opening files.
This list is configured using the Set File Search Path() function. See “Set File Search Path({path or list of paths})”.
Returns
A list of pathnames as strings.
Get Path Variable("name")
Description
Retrieves the value of name, a path variable.
Returns
The absolute pathname as a string.
Argument
name
A quoted string that contains a path variable. (Examples: SAMPLE_DATA, SAMPLE_SCRIPTS)
Is Directory(path)
Description
Returns 1 if the path argument is a directory and 0 otherwise.
Is Directory Writable(path)
Description
Returns 1 if the directory specified in the path argument is writable and 0 otherwise.
Is File(path)
Description
Returns 1 if the path argument is a file and 0 otherwise.
Is File Writable(path)
Description
Returns 1 if the file specified in the path argument is writable and 0 otherwise.
Is Log Open()
Description
Returns a Boolean value that indicates whether the log window is open.
Last Modification Date("path")
Description
Returns the last modification date of the specified file or directory.
Returns
Last modification date.
Arguments
path
Specifies the directory or file name.
Load Text File(path, <arguments>)
Description
Reads the text file at path into a JSL variable.
Returns
A string.
Arguments
path
A pathname that points to a text file. The path can be a URL.
Charset
Optional argument that determines the character set. Arguments include the following:
"best guess" attempts to detect the character set.
force("throw"|"alert"|"silent") is an optional argument that determines what happens if the character set cannot be detected.
Line Separator("character")
Optional argument that specifies the end-of-line character. For example, "!n" specifies a line feed character. "!t" specifies a tab.
XMLParse
Optional argument that converts an XML file into JSL.
SASODSXML
Optional argument that parses the text file as SAS ODS default XML.
BLOB(<arguments>)
Optional argument that returns data from the file as a blob rather than a string. The following optional arguments are for reading parts of the file:
ReadOffsetFromBegin(n) specifies the zero-based offset to begin reading from the beginning of the file.
ReadOffsetFromEnd(n) specifies the zero-based offset to begin reading from the end of the file.
ReadLength(n) specifies the number of bytes to read from the file, either from the beginning of the file or from one of the offset values.
Base64Compressed(0|1) specifies how the blob is converted to a printable representation. 0, the default and recommended setting, uses JMP’s ASCII~HEX representation. 1 means the blob is compressed and converted to base 64 when printed.
Move Directory("from path", "to path")
Description
Moves a directory and its contents (including subdirectories) from the specified path to another specified path.
Returns
Returns 1 if the directory is moved; otherwise returns 0.
Arguments
from path
Specifies the path and directory for relocation.
to path
Specifies the destination path and directory.
Move File("from path", "to path")
Description
Moves a file from the specified path to another specified path with the same or different file name.
Returns
Returns 1 if the file is moved; otherwise returns 0.
Arguments
from path
Specifies the path and file name for relocation.
to path
Specifies the destination path and file name.
Notes
On Windows, when you move a file to a folder that does not exist, Windows creates the folder and returns 1. On Macintosh, the folder is not created, and an error is returned.
Open("path", <arguments>)
Description
Opens the data table or other JMP file or object created from a file named by the path. If no path is specified, the Open window appears. Also opens JSON and HDF5 files. Refer to the examples in the JMP Scripting Index for details about which arguments apply to specific file types.
Arguments
Charset("option")
The available character set options for importing text files are Best Guess, utf-8, utf-16, us-ascii, windows-1252, x-max-roman, x-mac-japanese, shift-jis, euc-jp, utf-16be, and gb2312.
Column Names Start(n) | Column Names are on line(n)
Specifies the line number that column names start in the imported text file. If the text file uses returns between cells, column names could be on multiple lines.
Columns(colName = colType(colWidth),...)
Specifies the columns by name in the text file to import into a data table where:
colName: Specifies the column name used in the imported text file.
colType(Character | Numeric): Indicates whether the specified column contains character or numeric data.
colWidth(n): indicates the integer width of the specified column.
Columns(<arguments>)
For ESRI shapefiles (.shp), this argument and its settings indicate the following:
Shape=numeric(n): Indicates the column number in the imported ESRI shapefile that contains the shape number.
Part=numeric(n): Indicates the column number in the imported ESRI shapefile that contains the part number.
X=numeric(n): Indicates the column number in the imported ESRI shapefile that contains the decimal degree for the longitude (range of ±180°).
Y=numeric(n): Indicates the column number in the imported ESRI shapefile that contains the decimal degree for the latitude (range of ±90°).
Compress Allow List Check(Boolean)
Indicates that JMP can compress data table created from the imported text file.
Compress Character Columns(Boolean)
Indicates that JMP should compress data table columns that contain character data from the imported text file.
Compress Numeric Columns(Boolean)
Indicates that JMP should compress data table columns that contain numeric data from the imported text file.
Concatenate Worksheets(Boolean)
Indicates that JMP should combine the imported Excel worksheets into one data table.
Create Concatenation Column(Boolean)
Indicates that JMP should combine columns from an imported Excel file into one column.
Data Starts(n) | Data Starts on Line(n)
Specifies the line number where data starts in the imported text file.
Debug JSL(Boolean)
Opens the specified JSL script in the Debugger instead of opening it.
End Of Field(Tab|Space|Comma|Semicolon|Other|None)
Specifies the character used to delimit the end of a field in the imported text file. To specify multiple characters, separate each character designation by a comma. If you use “Other”, designate the delimiter with EOF Other() argument.
End Of Line(CRLF|CR|LF|Semicolon|Other)
Specifies the character used to delimit the end of a line in the imported text file. To specify multiple characters, separate each character designation by a comma. If you use “Other”, designate the delimiter with EOL Other() argument.
EOF Other("char")
If the imported text file uses an end of field character other than the one specified by End of Field, this argument specifies the character used.
EOL Other("char")
If the imported text file uses an end of line character other than the one specified by End of Line, this argument specifies the character used.
Excel Wizard
Opens Microsoft Excel worksheets in the Excel Import Wizard. If you omit this argument, the worksheets open directly as a data table.
File Type
An optional string that specifies the type of file that you are opening (for example, xls, bmp, jpg, or gif). If you do not specify this string, the file opens in the default program for the file type.
Note: The path argument should be used for a zip archive. The extension (.zip) is not required. See “Zip Archives” in the “JSL Messages” chapter for the messages that you can send to a zip archive. The basic functionality is to get a list of files in the zip archive, to read a file in the zip archive into either a string or a blob, and to write files into the zip archive. Note that reading a zip archive temporarily puts the contents into memory. Reading very large zip archives can cause errors.
Force Refresh
Closes the specified JMP (.jrn, .jsl, .jrp, or .jmpappsource) file without saving and tries to reopen the file from disk. This argument deletes any changes made since the last time the file was opened.
HTML Table(n, ColumnNames(n), DataStarts(n))
To import a table from an HTML web page, use the URL as the filepath. The optional n argument specifies which table number, n, on the web page to open. If you omit the value, only the first table on the page is imported. The optional ColumnNames(n) specifies the row that contains column names. The optional DataStarts(n) specifies the row on which the data begins.
Tip: If the table you are importing contains images, they are first imported as text. To load the images in your JMP data table, run the automatically generated table script named Load Pictures. A new expression column containing the images is created. See The Column Info Window chapter in the Using JMP book for details about expression columns.
Ignore Columns( "col", ... )
Indicates the column names in the JMP data table or other JMP file that should not be included in the data table.
Invisible
Opens the file as invisible. This quoted keyword applies to the files: data table, JMP file, external, text, Excel, SAS, ESRI shapefile, or HTML. The data table appears only in the JMP Home Window and the Window menu.
Labels(Boolean)
Indicates the imported text file contains labels or column headers as the first line in the file. The default value is True.
Lines to Read(n)
Specifies the number of lines in the text file to import. JMP starts counting lines after column names are read.
Number of Columns(n)
Specifies the number of columns contained in the imported text file.
Run JSL(Boolean)
Runs the specified JSL file instead of opening it. Include a Boolean argument or an expression that contains a Boolean value. If the script begins with //!, which automatically runs the script, include the Boolean value (0) to open the script instead.
Password( "password" )
Specifies the password for a password-protected Microsoft Excel .xls or SAS files to avoid entering it manually. The password is not encrypted. (Password-protected Microsoft Excel .xlsx files cannot be imported.)
Private
Opens the table as invisible and without showing it in the JMP Home Window or Window menu. For example, you might create a private data table to hold temporary data that the user does not need to see. This quoted keyword applies to the following files: data table, JMP file, external, text, Excel, SAS, ESRI shapefile, or HTML. Using private data tables saves memory for smaller tables. However, for large tables (for example, 100 columns and 1,000,000 rows), using a private data table is not helpful because the data requires a lot of memory.
Scan Whole File(Boolean)
Specifies how long JMP scans the text file to determine data types for the columns. This is a Boolean value. The default value is true; the entire file is scanned until the data type is determined. To import large files, consider setting the value to false, which scans the file for five seconds.
Select Columns( "col", ... )
Indicates the column names in the JMP data table or other JMP file that should be included in the data table.
Strip Quotes | Strip Enclosing Quotes (Boolean)
If the fields in the text file are quoted, setting this to True removes the quotes, and setting it to False does not remove the quotes. The default value is True.
Table Contains Column Headers (Boolean)
Indicates the imported text file contains labels or column headers as the first line in the file. The default value is True.
Text Wizard
Opens the text file in the text import window, where you can select import options. Otherwise, the Text Data Files options in the JMP preferences apply, and the text file is automatically imported as a data table.
Treat Empty Columns as Numeric(Boolean)
Indicates that JMP should import text file columns of missing data as numeric rather than character. Possible missing value indicators are a period, a Unicode dot, NaN, or a blank string. The default value is False.
Use Apostrophe as Quotation Mark(Boolean)
Declares apostrophes as quotation marks in importing text files. This option is not recommended unless your data comes from a nonstandard source that places apostrophes around data fields rather than quotation marks. The default value is False.
Use Labels for Var Names(Boolean)
For SAS data sets, this option specifies to use SAS labels as JMP columns names. The default value is False.
Use for all sheets(Boolean)
Indicates that JMP should use the Worksheets settings for all worksheets in the Excel file to be opened as a data table.
Worksheet Settings(Boolean, <options>)
Specifies options for importing an Excel file into a JMP data table. Available options are:
Has Column Headers(Boolean) - Indicates the Excel file has column headers in the first row.
Number of Rows in Headers(n) - Specifies the number of rows in the Excel file used as column headers.
Headers Start on Row(n) - Specifies the row number in the Excel file where the column headers begin. Default is row 1.
Data Starts on Row(n) - Specifies the row number in the Excel file where the data begins.
Data Starts on Column(n) - Specifies the column number in the Excel file where the data begins.
Data Ends on Row(n) - Specifies the row number in the Excel file where data ends.
Data Ends on Column(n) - Specifies the column number in the Excel file where the data ends.
Replicated Spanned Rows(Boolean) - Indicates the Excel file contains spanned columns that should be imported into JMP as spanned columns.
Suppress Hidden Rows(Boolean) - Indicates that JMP should not import rows hidden in the Excel file.
Suppress Hidden Columns(Boolean) - Indicates that JMP should not import columns hidden in the Excel file.
Treat as Hierarchy(Boolean) - Indicates that JMP should treat multiple column headers (merged cells) as hierarchies when importing an Excel file. If True, the Excel file opens with the merged columns stacked (Tables > Stacked).
Worksheets ("sheet name"|{"sheet name", "sheet name",...}|”n”)
Opens the specified Excel file worksheet by name, all worksheets in a list of names, or the indexed number of the worksheet. If the worksheets are not specified, all worksheets in the spreadsheet open as separate data tables.
Year Rule | Two digit year rule ("1900-1999"|"1910-2009"|"1920-2019"|"1930-2029"|"1940-2039"| "1950-2049"|"1960-2059"|"1970-2069"|"1980-2079"|"1990-2089"|"2000-2099")
Indicates the year format used in the imported text file. For example, if the earliest date is 1979, use “1970-2069”.
Open Database("connectInfo" "sqlStatement", "outputTableName")
Description
Opens the database indicated by connectInfo with the sqlStatement, returning a data table named outputTableName.
Pick Directory(<"prompt">, <path>, <Show Files>)
Description
Prompts the user for a directory, returning the directory path as a string.
Returns
The path for the directory that the user selects.
Arguments
prompt
An optional quoted string. If provided, that string appears at the top of the Browse window on Windows.
path An optional quoted string that specifies the initial directory that appears in the Pick Directory window.
Show Files (Boolean) Specify 1 to show files in the Pick Directory window, or zero to hide files. The default is zero.
Pick File(<"prompt">, <"initial directory">, <{filter list}>, <first filter>, <save flag>, <"default file">), <multiple>
Description
Prompts the user to select one or more files in the Open window.
Returns
The path of the file that the user selects.
Arguments
prompt
An optional quoted string. If provided, that string appears at the top of the Open window.
initial directory
An optional quoted string that is a valid filepath to a folder. If provided, it specifies where the Open window begins. If not provided, or if it’s an empty string, the JMP Default Directory is used.
filter list
An optional list of quoted strings that define the filetypes to show in the Open window. See the following example for syntax.
first filter
An optional integer that specifies which of the filters in the filter list to use initially. If you use an integer that is too large or small for the list (for example, 4 for a list of 3), the first filter in the list is used.
save flag
An optional Boolean that specifies whether the Open window or Save window is used. 0 lets the user select a file to open in JMP. 1 lets the user save a new, empty file of the selected type in the selected folder. The default value is 0.
default file
The name of the file that appears in the window by default.
multiple
An optional argument that lets the user select multiple files if the save flag is 0.
Notes
Although all arguments are optional, they are also positional. For example, you cannot specify a filter list without also specifying the caption and the initial directory.
The buffer size in the computer’s physical memory affects the number of files the user can open.
Example
The following script assigns Select JMP File as the window title; shows the JMP Samples/Data directory; shows JMP Files and All Files in the File name list and selects JMP Files; displays the Open window; and shows the sample data file name Hollywood Movies.jmp.
Pick File(
"Select JMP File",
"$SAMPLE_DATA",
{"JMP Files|jmp;jsl;jrn", "All Files|*"},
1,
0,
"Hollywood Movies.jmp"
);
Rename Directory("old path name", "new directory name")
Description
Renames a directory without moving or copying it.
Returns
Returns 1 if the directory is renamed; otherwise, returns 0.
Arguments
old path name
Specifies the path and old directory name.
new name
Specifies the new directory name.
Notes
When you specify the new directory name, include only the directory name, not the entire path.
Rename File("old path name", "new name")
Description
Renames a file without moving or copying it.
Returns
Returns 1 if the file is renamed; otherwise, returns 0.
Arguments
old path name
Specifies the path and old file name.
new name
Specifies the new file name.
Notes
When you specify the new name, include only the file name, not the entire path.
Save Text File(path, text)
Description
Saves the JSL variable text into the file specified by path.
Set Current Directory("path")
Description
Sets the current directory for Open File operations. Note: The operating system can change the current directory outside of JMP. The function is deprecated. Setting the current directory saves or returns the new value for backwards compatibility though the value is not used.
To avoid having to set the current directory for each file operation, define a filepath string and concatenate it with the filename. See the Path Variables section in the Scripting Guide for details.
Set Default Directory("path")
Description
Sets the default directory, which is used for resolving relative paths.
Set File Search Path({path or list of paths})
Description
Sets the current list of directories to search for opening files. Using {"."} as the path configures JMP to use the current directory.
Example
Set File Search Path( {"C:/JMP/13/source", "C:/Program Files/SAS/JMPPRO/13/Samples"} );
Set Path Variable("name")
Description
Sets the path stored in the variable.
TripleS Import("path", <arguments>)
Description
Imports the specified Triple-S Survey (SSS) file. The SSS format consists of a pair of files: .xml or .sss, and a .csv, .dat, or .asc file. Both sets of files must have the same root name and be in the same folder.
Arguments
path
Quoted string that contains the full path to the .xml or .sss file.
Invisible
Optional. Hides the table from view. The data table appears only in the JMP Home Window and the Window menu. Hidden data tables remain in memory until they are explicitly closed, reducing the amount of memory that is available to JMP. To explicitly close the hidden data table, call Close(dt), where dt is the data table reference returned by TripleS Import.
Use Labels for Imported Columns
Optional Boolean. Converts the label names to column headings. The default value is true.
Example
dt = TripleS Import( "C:/Data/airlines.sss", Invisible, Use Labels for Imported Column Names( 0 ) );
Financial Functions
Double Declining Balance(cost, salvage, life, period, <factor>)
Description
Returns the depreciation of an asset for a specified period of time. The function uses the double-declining balance method or some other depreciation factor.
Arguments
cost
The initial cost.
salvage
The value at the end of the depreciation.
life
The number of periods in the depreciation cycle.
period
The length of the period, in the same units as life.
factor
An optional number that is the rate at which the balance declines. The default value is 2.
Note
This function is equivalent to the Excel function DDB.
Future Value(rate, nper, pmt, <pv>, <type>)
Description
Returns the future value of an investment that is based on periodic, constant payments and a constant interest rate.
Arguments
rate
The interest rate.
nper
The number of periods.
pmt
The constant payment.
pv
An optional number that is the present value. The default value is 0.
type
An optional switch. 0 specifies end-of-period payments, and 1 specifies beginning-of-period payments. The default value is 0.
Note
This function is equivalent to the Excel function FV.
Interest Payment(rate, per, nper, pv, <fv>, <type>)
Description
Returns the interest payment for a given period for an investment that is based on periodic, constant payments and a constant interest rate.
Arguments
rate
The interest rate.
per
The period for which you want the interest.
nper
The total number of periods.
pv
The present value.
fv
An optional number that is the future value. The default value is 0.
type
An optional switch. 0 specifies end-of-period payments, and 1 specifies beginning-of-period payments. The default value is 0.
Note
This function is equivalent to the Excel function IPMT.
Interest Rate(nper, pmt, pv, <fv>, <type>, <guess>)
Description
Returns the interest rate per period of an annuity.
Arguments
nper
The total number of periods.
pmt
The constant payment.
pv
The present value.
fv
An optional number that is the future value. The default value is 0.
type
An optional switch. 0 specifies end-of-period payments, and 1 specifies beginning-of-period payments. The default value is 0.
guess
An optional number that is what you think the rate will be. The default value is 0.1 (10%).
Note
This function is equivalent to the Excel function RATE.
Internal Rate of Return(values, <guess>)
Internal Rate of Return(guess, value1, value2, ...)
Description
Returns the internal rate of return for a series of cash flows in the values argument.
Arguments
values
A one-dimensional matrix of values. If the second form of the function is used, list each value separately.
guess
The number that you think is near the result. The default value is 0.1 (10%).
Note
This function is equivalent to the Excel function IRR.
Modified Internal Rate of Return(values, finance rate, reinvest rate)
Modified Internal Rate of Return(finance rate, reinvest rate, value1, value2, ...)
Description
Returns the modified internal rate of return for a series of periodic cash flows. The cost of investment and the interest received on reinvested cash is included.
Arguments
values
A one-dimensional matrix of values. If the second form of the function is used, list each value separately.
finance rate
The interest rate that you pay on the money in the cash flows.
reinvest rate
The interest rate that you receive on the cash flows when you reinvest them.
Note
This function is equivalent to the Excel function MIRR.
Net Present Value(rate, values)
Net Present Value(rate, value1, value2, ...)
Description
Returns the net present value of an investment by using a discount rate and a series of future payments (negative values) and income (positive values).
Arguments
rate
The discount rate.
values
A one-dimensional matrix of values. If the second form of the function is used, list each value separately.
Note
This function is equivalent to the Excel function NPV.
Number of Periods(rate, pmt, pv, <fv>, <rate>)
Description
Returns the number of periods for an investment that is based on periodic, constant payments and a constant interest rate.
Arguments
rate
The interest rate.
pmt
The constant payment.
pv
The present value.
fv
An optional number that is the future value. The default value is 0.
type
An optional switch. 0 specifies end-of-period payments, and 1 specifies beginning-of-period payments. The default value is 0.
Note
This function is equivalent to the Excel function NPER.
Payment(rate, nper, pv, <fv>, <type>)
Description
Returns the payment for a loan that is based on constant payments and a constant interest rate.
Arguments
rate
The interest rate.
nper
The total number of periods.
pv
The present value.
fv
An optional number that is the future value. The default value is 0.
type
An optional switch. 0 specifies end-of-period payments, and 1 specifies beginning-of-period payments. The default value is 0.
Note
This function is equivalent to the Excel function PMT.
Present Value(rate, nper, pmt, <fv>, <type>)
Description
Returns the present value of an investment.
Arguments
rate
The interest rate per period.
nper
The total number of periods.
pmt
The constant payment.
fv
An optional number that is the future value. The default value is 0.
type
An optional switch. 0 specifies end-of-period payments, and 1 specifies beginning-of-period payments. The default value is 0.
Note
This function is equivalent to the Excel function PV.
Principal Payment(rate, per, nper, pv, <fv>, <type>)
Description
Returns the payment on the principal for a given period for an investment that is based on periodic, constant payments and a constant interest rate.
Arguments
rate
The interest rate per period.
per
The period for which you want the interest.
nper
The total number of periods.
pv
The present value.
fv
An optional number that is the future value. The default value is 0.
type
An optional switch. 0 specifies end-of-period payments, and 1 specifies beginning-of-period payments. The default value is 0.
Note
This function is equivalent to the Excel function PPMT.
Straight Line Depreciation(cost, salvage, life)
Description
Returns the straight-line depreciation of an asset for one period.
Arguments
cost
The initial cost of the asset.
salvage
The value at the end of the depreciation.
life
The number of periods in the depreciation cycle.
Note
This function is equivalent to the Excel function SLN.
Sum Of Years Digits Depreciation(cost, salvage, life, per)
Description
Returns the sum-of-years’ digits depreciation of an asset for a specified period.
Arguments
cost
The initial cost of the asset.
salvage
The value at the end of the depreciation.
life
The number of periods in the depreciation cycle.
per
The length of the period, in the same units as life.
Note
This function is equivalent to the Excel function SYD.
Graphic Functions
Add Color Theme({"name", <flags>, {color}, <{position}>)
Description
Creates a custom color theme that you can apply to components such as markers, data table rows, and treemaps. Add the color theme to the JMP Preferences by including Add Color Theme(...) inside Preferences().
Returns
Null.
Arguments
name
The name of the color theme.
flags
An optional flag for the Continuous or Categorical color theme list and category of color.
Continuous, <Continuous>, Sequential
Continuous, <Continuous>, Diverging
Continuous, <Continuous>, Chromatic
Categorical, <Continuous>, Sequential
Categorical, <Continuous>, Diverging
Categorical, Qualitative
Categorical, <Continuous>, Chromatic
With the default JMP color themes, Sequential colors transition from left to right or right to left. Diverging colors are lighter in the middle. Chromatic colors consist of blocks or gradients of bright color. All categories except for Qualitative can be both continuous and categorical.
If you omit the flag, the color is shown in the Continuous, Sequential and Categorical, Sequential categories.
color
Lists of RGB values. These values define the blocks in categorical color themes and the gradients in continuous color themes. Each list of RGB values corresponds to a slider in the preferences Color Themes window.
position
An optional list of numbers between 0 and 1 with one position per color. Each position corresponds to a slider in the preferences Color Themes window. If you omit the position, the sliders are evenly spaced.
Examples
The following example creates a continuous color theme named Blue to Purple. The color is in the Diverging category. RGB values are defined in the four lists.
Add Color Theme(
{"Blue to Purple", {"Continuous", "Diverging"}, {{0, 0, 255},
{57, 108, 244}, "white", {128, 0, 100}}} );
Notes
Any style except for Qualitative can be Continuous and Categorical at the same time. For example, the Cool to Warm Diverging theme is in the Continuous and Categorical theme lists. In JMP, select Preferences > Graphs to see examples.
To delete a color theme, use Remove Color Theme("name").
Arc(x1, y1, x2, y2, startangle, endangle)
Description
Inscribes an arc in the rectangle described by the arguments.
Returns
Null.
Arguments
x1, y1
The point at the top left of the rectangle
x2, y2
The point at the bottom right of the rectangle
startangle, endangle
The starting and ending angle in degrees, where 0 degrees is 12 o'clock and the arc or slice is drawn clockwise from startangle to endangle.
Arrow(<pixellength>, {x1, y1}, {x2, y2})
Description
Draws an arrow from the first point to the second point. The optional first argument specifies the length of the arrow’s head lines (in pixels).
Returns
Null.
Arguments
pixellength
Optional: specifies the length of the arrowhead in pixels.
{x1, y1}, {x2, y2}
Two lists of two numbers that each specify a point in the graph.
Notes
The two points can also be enclosed in square brackets: Arrow(<pixellength>, [x1, x2], [y1, y2]).
Back Color("name")
Description
Sets the color used for filling the graph’s background.
Returns
Null.
Argument
name
A quoted color name or a color index (such as "red" or "3" for the color red).
Char To Path("path")
Description
Converts a path specification from a string to a matrix.
Returns
A matrix.
Arguments
path
A string that contains the path specification.
Circle({x, y}, radius|PixelRadius(n), <...>, <"fill">)
Description
Draws a circle centered at {x, y} with the specified radius.
Returns
Null.
Arguments
{x, y}
A number that describes a point in the graph
radius
A number that describes the length of the circle’s radius in relation to the vertical axis. If the vertical axis is resized, the circle is also resized.
PixelRadius(n)
A number that describes the length of the circle’s radius in pixels. If the vertical axis is resized, the circle is not resized.
"fill"
Optional string. Indicates that all circles defined in the function are filled with the current fill color. If "fill" is omitted, the circle is empty.
Note
The center point and the radius can be placed in any order. You can also add additional center point and radius arguments and draw more than one circle in one statement. One point and several radii results in a bull’s-eye. Adding another point still draws all previous circles, and then adds an additional circle with the last radius specified. This means that this code:
graphbox(circle({20, 30}, 5, {50, 50}, 15))
results in three circles, not two. First, a circle with radius 5 is drawn at 20, 30. Second, a circle with radius 5 is drawn at 50, 50. Third, a circle with radius 15 is drawn at 50, 50.
Color To HLS(color)
Description
Converts the color argument (including any JMP color) to a list of HLS values.
Returns
A list of the hue, lightness, and saturation components of color. The values range between 0 and 1.
Argument
color
a number from the JMP color index.
Example
The output from ColorToHLS() can either be assigned to a single list variable or to a list of three scalar variables:
hls = Color To HLS( 8 );
{h, l, s} = Color To HLS( 8 );
Show( hls, h, l, s );
hls = {0.778005464480874, 0.509803921568627, 0.976};
h = 0.778005464480874;
l = 0.509803921568627;
s = 0.976;
Color To RGB(color)
Description
Converts the color argument (including any JMP color) to a list of RGB values.
Returns
A list of the red, green, and blue components of color. The values range between 0 and 1.
Argument
color
a number from the JMP color index.
Example
The output from ColorToRGB() can either be assigned to a single list variable or to a list of three scalar variables:
rgb = Color To RGB( 8 );
{r, g, b} = Color To RGB( 8 );
Show( rgb, r, g, b );
rgb = {0.670588235294118, 0.0313725490196078, 0.988235294117647};
r = 0.670588235294118;
g = 0.0313725490196078;
b = 0.988235294117647;
Contour(xVector, yVector, zGridMatrix, zContour, <zColors>)
Description
Draws contours given a grid of values.
Returns
None.
Arguments
xVector
The n values that describe zGridMatrix.
yVector
The m values that describe zGridMatrix.
zGridMatrix
An nxm matrix of values on some surface.
zContour
Optional: Definition of values for the contour lines.
zColors
Optional: Definition of colors to use for the contour lines.
Contour Function(expr, xName, yName, z, < <<XGrid(min, max, incr)>, < <<YGrid(min, max, incr)>, < <<zColor(color)>, < <<zLabeled>, < <<Filled>, < <<FillBetween>, < <<Ternary>, < <<Transparency(alpha|vector))
Description
Draws sets of contour lines of the expression, a function of the two symbols. The z argument can be a single value or an index or matrix of values.
Returns
None.
Arguments
expr
Any expression. For example, Sine(y)+Cosine(x).
xName, yName
Values to use in the expression.
z
A z-value or a matrix of z-values.
Optional Arguments
<<XGrid, <<YGrid
Defines a box, beyond which the contour lines are not drawn.
<<zColor
Defines the color in which to draw the contour lines. The argument can be either a scalar or a matrix, but must evaluate to numeric.
<<zLabeled
Labels the contours.
<<Filled
Fills the contour levels using the current fill color.
<<FillBetween
Fills only between adjacent contours using the current fill color. For nz contours specified, this option fills nz-1 regions for the intervals between the nz values. Using this option is recommended over using the <<Filled option.
<<Ternary
Clips lines to be within the ternary coordinate system inside ternary plots.
<<Transparency
sets the transparency level of the fill. A vector of numbers between 0 and 1 are sequenced through and cycled for the z contours. This option should be used only in conjunction with the <<FillBetween option.
Drag Line(xMatrix, yMatrix, <dragScript>, <mouseupScript>)
Description
Draws line segments between draggable vertices at the coordinates given by the matrix arguments.
Returns
None.
Arguments
xMatrix
A matrix of x-coordinates.
yMatrix
A matrix of y-coordinates.
dragScript
Any valid JSL script; it is run at drag.
mouseupScript
Any valid JSL script; it is run at mouseup.
Drag Marker(xMatrix, yMatrix, <dragScript>, <mouseupScript>)
Description
Draws draggable markers at the coordinates given by the matrix arguments.
Returns
None.
Arguments
xMatrix
A matrix of x-coordinates.
yMatrix
A matrix of y-coordinates.
dragScript
Any valid JSL script; it is run at drag.
mouseupScript
Any valid JSL script; it is run at mouseup.
Drag Polygon(xMatrix, yMatrix, <dragScript>, <mouseupScript>)
Description
Draws a filled polygon with draggable vertices at the coordinates given by the matrix arguments.
Returns
None.
Arguments
xMatrix
A matrix of x-coordinates.
yMatrix
A matrix of y-coordinates.
dragScript
Any valid JSL script; it is run at drag.
mouseupScript
Any valid JSL script; it is run at mouseup.
Drag Rect(xMatrix, yMatrix, <dragScript>, <mouseupScript>)
Description
Draws a filled rectangle with draggable vertices at the first two coordinates given by the matrix arguments.
Returns
None.
Arguments
xMatrix
A matrix of 2 x-coordinates.
yMatrix
A matrix of 2 y-coordinates.
dragScript
Any valid JSL script; it is run at drag.
mouseupScript
Any valid JSL script; it is run at mouseup.
Note
xMatrix and yMatrix should each contain exactly two values. The resulting coordinate pairs should follow the rules for drawing a rect(); the first point (given by the first value in xMatrix and the first value in yMatrix) must describe the top, left point in the rectangle, and the second point (given by the second value in xMatrix and the second value in yMatrix) must describe the bottom, right point in the rectangle.
Drag Text(xMatrix, yMatrix, "text", <dragScript>, <mouseupScript>)
Description
Draws the text (or all the items if a list is specified) at the coordinates given by the matrix arguments.
Returns
None.
Arguments
xMatrix
A matrix of x-coordinates.
yMatrix
A matrix of y-coordinates.
text
A quoted string to be drawn in the graph.
dragScript
Any valid JSL script; it is run at drag.
mouseupScript
Any valid JSL script; it is run at mouseup.
Fill Color(n)
Description
Sets the color used for filling solid areas.
Returns
None.
Argument
n
Index for a color or a quoted color name.
Fill Pattern()
Description
Sets the pattern for filled areas. See the Scripting Graphs chapter in the Scripting Guide for examples.
Gradient Function(zexpr, xname, yname, [zlow, zhigh], zcolor([colorlow, colorhigh]), < <<XGrid(min, max, incr)>, < <<YGrid(min, max, incr)> < <<Transparency(alpha|vector))
Description
Fills a set of rectangles on a grid according to a color determined by the expression value as it crosses a range corresponding to a range of colors.
Example
Gradient Function(Log(a * a + b * b),
a, b, [2 10],
Z Color([4, 6]));
Zexpr is a function in terms of the two following variables (a and b), whose values range from zlow to zhigh (2 to 10). Zcolor defines the two colors that are blended together (4 is green, 6 is orange).
H Line(<x1, x2>, y)
Description
Draws a horizontal line at y across the graph. If you specify start and end points on the x-axis (x1 and x2), the line is drawn horizontally at y from x1 to x2. You can also draw multiple lines by using a matrix of values in the y argument.
H Size()
Description
Returns the horizontal size of the graphics frame in pixels.
Handle(a, b, dragScript, mouseupScript)
Description
Places draggable marker at coordinates given by a, b. The first script is executed at drag and the second at mouseup.
Heat Color(n, <"color theme">)
Description
Returns the JMP color that corresponds to n in the color "theme".
Returns
An integer that is a JMP color.
Arguments
n
A value between 0 and 1.
theme
Any quoted color theme that is supported by Cell Plot. The default value is "Blue to Gray to Red".
HLS Color(h, l, s)
HLS Color({h, l, s})
Description
Converts hue, lightness, and saturation values into a JMP color number.
Returns
An integer that is a JMP color number.
Arguments
Hue, lightness, and saturation, or a list containing the three HLS values. All values should be between 0 and 1.
In Path(x, y, path)
Description
Determines it the point described by x and y falls in path.
Returns
True (1) if the point (x, y) is in the given path, False(0) otherwise.
Arguments
x and y
The coordinates of a point.
path
Either a matrix or a string describing a path.
In Polygon(x, y, xx, yy)
In Polygon(x, y, xyPolygon)
Description
Returns 1 or 0, indicating whether the point (x, y) is inside the polygon that is defined by the xx and yy vector arguments.
The vector arguments (xx, yy) can also be combined into a 2-column matrix (xyPolygon), allowing you to use three arguments instead of four. Also, x and y can be conformable vectors, and then a vector of 0s and 1s are returned based on whether each (x, y) pair is inside the polygon.
Level Color(i, <n>, <"Color Theme">)
Description
Assigns a JMP color to categorical data in a graphic.
Returns
An integer that is a JMP color.
Arguments
i
An integer that is greater than or equal to 1 and less than or equal to the number of categories specified by n.
n
The number of categories.
"Color Theme"
A color theme from the Value Color list of the Column Properties window. If not specified, the JMP Default color theme is applied.
Note
When the second argument is a character string and not n, then the second argument determines the color theme.
Line({x1, y1}, {x2, y2}, ...), <<ValueSpace(0|1)
Line([x1, x2, ...], [y1, y2, ...]), <<ValueSpace(0|1)
Description
Draws a line between points.
Arguments
{x1, y1}, {x2, y2} or [x1, x2, ...], [y1, y2, ...]
Can be any number of lists of two points, separated by commas; or a matrix of x’s and a matrix of y’s.
<<ValueSpace (Boolean)
Draws lines that follow the projection when the line represents a movement of the underlying data, such as a bubble trail in a bubble plot. The Boolean value can be a constant or an expression.
Line Style(n)
Description
Sets the line style used to draw the graph.
Argument
n
Can be either a style name or the style’s number:
0 or Solid
1 or Dotted
2 or Dashed
3 or DashDot
4 or DashDotDot
Marker(<markerState>, {x1, y1}, {x2, y2}, ...)
Marker(<markerState>, [x1, x2, ...], [y1, y2, ...})
Description
Draws one or more markers at the points described either by lists or matrices. The optional markerState argument sets the type of marker.
Marker Size(n)
Description
Sets the size used for markers.
Mousetrap(dragscript, mouseupscript)
Description
Captures click coordinates to update graph properties. The first script is executed at drag and the second at mouseup.
Normal Contour(prob, meanMatrix, stdMatrix, corrMatrix, <colorsMatrix>, <fill=x>)
Description
Draws normal probability contours for k populations and two variables.
Arguments
prob
A scalar or matrix of probabilities.
meanMatrix
A matrix of means of size k by 2.
stdMatrix
A matrix of standard deviations of size k by 2.
corrMatrix
A matrix of correlations of size k by 1.
colorsMatrix
Optional. Specifies the color(s) for the k contour(s). The colors must be specified as JSL colors (either JSL color integer values or return values of JSL Color functions such as RGB Color or HLS Color).
fill=x
Optional. Specifies the amount of transparency for the contour fill color.
Oval(x1, y1, x2, y2, <fill>)
Oval({x1, y1}, {x2, y2}, <fill>)
Description
Draws an oval inside the rectangle whose diagonal has the coordinates (x1, y1) and (x2, y2). Fill is Boolean. If fill is 0, the oval is empty. If fill is nonzero, the oval is filled with the current fill color. The default value for fill is 0.
Path(path, <fill>)
Description
Draws a stroke along the given path. If a fill is specified, the interior of the path is filled with the current fill color.
Argument
path
Can be either an Nx3 matrix or a string that contains SVG syntax.
fill
An optional, Boolean argument that specifies whether a line is drawn (0) or the path is filled (1). The default value is 0.
Note
A path matrix has three columns, for x and y, and a flag. The flag value for each point can be 0 for control, 1 for move, 2 for line segment, 3 for cubic Bézier segment, and any negative value to close the path.
Path To Char(path)
Description
Converts a path specification from a matrix to a string.
Returns
A string.
Argument
path
An Nx3 path matrix.
Note
A path matrix has three columns, for x and y, and a flag. The flag value for each point can be 0 for control, 1 for move, 2 for line segment, 3 for cubic Bézier segment, and any negative value to close the path.
Pen Color(n)
Description
Sets the color used for the pen.
Pen Size(n)
Description
Sets the thickness of the pen in pixels.
Pie(x1, y1, x2, y2, startangle, endangle)
Description
Draws a filled pie slice. The two points describe a rectangle, within which is a virtual oval. Only the slice described by the start and end angles is drawn.
Pixel Line To(x, y)
Description
Draws a one-pixel-wide line from the current pixel location to the location given in pixel coordinates. Set the current pixel location using the Pixel Origin and Pixel Move To commands.
Pixel Move To(x, y)
Description
Moves the current pixel location to a new location given in pixel coordinates.
Pixel Origin(x, y)
Description
Sets the origin, in graph coordinates, for subsequent Pixel Line To or Pixel Move To commands.
Polygon({x1, y1}, {x2, y2}, ...)
Polygon(xmatrix, ymatrix)
Description
Draws a filled polygon defined by the listed points.
Rect(x1, y1, x2, y2, <fill>)
Rect({x1, y1}, {x2, y2}, <fill>)
Description
Draws a rectangle whose diagonal has the coordinates (x1, y1) and (x2, y2). Fill is Boolean. If fill is 0, the rectangle is empty. If fill is nonzero, the rectangle is filled with the current fill color. The default value for fill is 0.
RGB Color(r, g, b)
RGB Color({r, g, b})
Description
Converts red, green, and blue values into a JMP color number.
Returns
An integer that is a JMP color number.
Arguments
Red, green, and blue, or a list containing the three RGB values. All values should be between 0 and 1.
Text(<properties>, ({x, y}|{left, bottom, right, top}), "text")
Description
Draws the quoted string text at the given point, either the x and y axes or the left, bottom, right, and top axes.
Properties can be any of several named arguments: Center Justified, Right Justified, Erased, Boxed, Counterclockwise, Position, and named arguments. The position, named arguments, and strings can be added in any order. The position and named arguments apply to all the strings.
Text Color(n)
Description
Sets the color for Text strings.
Text Size(n)
Description
Sets the font size in points for Text strings.
Transparency(alpha)
Description
Sets the transparency of the current drawing, with alpha between 0 and 1 where 0 is clear (no drawing) and 1 is completely opaque (the default).
Note
Not all operating systems support transparency.
V Line(x, <y1, y2>)
Description
Draws a vertical line at x across the graph. If you specify start and end points on the y-axis (y1 and y2), the line is drawn vertically at x from y1 to y2. You can also draw multiple lines by using a matrix of values in the x argument.
V Size()
Description
Returns the vertical size of the graphics frame in pixels
X Function(expr, symbol, <Min(min), Max(max), Fill(value), Inc(bound), Show Details(n)>)
Description
Draws a plot of the function as the symbol is varied over the y-axis of the graph.
X Origin()
Description
Returns the x-value for the left edge of the graphics frame
X Range()
Description
Returns the distance from the left to right edge of the display box. For example, X Origin() + X Range() is the right edge.
X Scale(xmin, xmax)
Description
Sets the range for the horizontal scale. The default value for xmin is 0, and the default value for xmax is 100.
XY Function(x(t), y(t), t, min(min), max(max), inc(bound) | steps(min))
Description
Combines an expression of x(t) and y(t) to draw an x-y curve for the specified range of parameter t.
Note: Either inc() or steps() is needed if the default granularity misses details.
Y Function(expr, symbol, <Min(min), Max(max), Fill(value), Inc(bound), Show Details(n)>)
Description
Draws a plot of the function as the symbol is varied over the x- axis of the graph.
Y Origin()
Description
Returns the y-value for the bottom edge of the graphics frame
Y Range()
Description
Returns the distance from the bottom to top edges of a display box. For example, Y Origin() + Y Range() is the top edge.
Y Scale(ymin, ymax)
Description
Sets the range for the vertical scale. If you do not specify a scale, it defaults to (0, 100).
List Functions
As List(matrix)
Description
Converts a matrix into a list. Multi-column matrices are converted to a list of row lists.
Returns
A list.
Argument
matrix
Any matrix.
Concat Items({string1, string2, ...}, <delimiter>})
Description
Converts a list of string expressions into one string, with each item separated by a delimiter. The delimiter is a blank, if unspecified.
Returns
The concatenated string.
Arguments
string
any string
delimiter
an optional string that is placed between each item. The delimiter can be more than one character long.
Example
str1 = "one";
str2 = "two";
str3 = "three";
 
comb = Concat Items({str1, str2, str3});
"one two three"
comb = Concat Items({str1, str2, str3}, " : ");
"one : two : three"
del = ",";
comb = Concat Items({str1, str2, str3}, del);
"one,two,three"
Eval List(list)
Description
Evaluates expressions inside list.
Returns
A list of the evaluated expressions.
Arguments
list
A list of valid JSL expressions.
Insert(source, item, <position>)
Insert(source, key, value)
Description
Inserts a new item into the source at the given position. If position is not given, item is added to the end.
For an associative array: Adds the key into the source associative array and assigns value to it. If the key exists in source already, its value is overwritten with the new value.
Arguments
source
A string, list, expression, or associative array.
item or key
Any value to be placed within source. For an associative array, key might or might not be present in source.
position
Optional numeric value that specifies the position in source to place the item into.
value
A value to assign to the key.
Insert Into(source, item, <position>)
Insert Into(source, key, value)
Description
Inserts a new item into the source at the given position in place. The source must be an L-value.
Arguments
source
A variable that contains a string, list, display box, expression, or associative array.
item or key
Any value to be placed within source. For an associative array, key might or might not be present in source.
position
Optional numeric value that specifies the position in source to place the item into.
value
A value to assign to the key.
Is List(x)
Description
Returns 1 if the evaluated argument is a list, or 0 otherwise.
List(a, b, c, ...)
{a, b, c, ...}
Description
Constructs a list from a set of items.
N Items(source)
Description
Determines the number of elements in the source specified.
Returns
For a list or display box, the number of items in the list or display box is returned. For an associative array, the number of keys is returned. For the matrix, the number of elements in the matrix is returned. For the namespace, the number of items in the namespace is returned.
Arguments
source
A list, associative array, matrix, display box, or namespace.
Remove(source, position, <n>)
Remove(source, {items})
Remove(source, key)
Description
Deletes the n item(s), starting from the indicated position. If n is omitted, the item at position is deleted. If position and n are omitted, the item at the end is removed. For an associative array: Deletes the key and its value.
Returns
A copy of the source with the items deleted.
Arguments
source
A string, list, expression, or associative array.
position or key
An integer (or list of integers) that points to a specific item (or items) in the list or expression.
n
Optional. An integer that specifies how many items to remove.
Remove From(source, position, <n>)
Remove From(source, key)
Description
Deletes the n item(s) in place, starting from the indicated position. If n is omitted, the item at position is deleted. If position and n are omitted, the item at the end is removed. For an associative array: Deletes the key and its value. The source must be an L-value.
Returns
The original source with the items deleted.
Arguments
source
A string, list, expression, display box, or associative array.
position or key
An integer (or list of integers) that points to a specific item (or items) in the list or expression.
n
Optional. An integer that specifies how many items to remove.
Reverse(source)
Description
Reverse order of elements or terms in the source.
Argument
source
A string, list, or expression.
Reverse Into(source)
Description
Reverses the order of elements or terms in source in place.
Argument
source
A string, list, display box, or expression.
Shift(source, <n>)
Description
Shifts an item or n items from the front to the back of the source.
Arguments
source
A string, list, or expression.
n
Optional. An integer that specifies the number of items to shift. Positive values shift items from the beginning of the source to the end. Negative values shift items from the end of the source to the beginning. The default value is 1.
Shift Into(source, <n>)
Description
Shifts items in place.
Arguments
source
A string, list, display box, or expression.
n
Optional. An integer that specifies the number of items to shift. Positive values shift items from the beginning of the source to the end. Negative values shift items from the end of the source to the beginning. The default value is 1.
Sort List(list |expr)
Description
Sort the elements or terms of list or expr.
Sort List Into(list |expr)
Description
Sort the elements or terms of list or expr in place.
Substitute(string, substring, replacementString, ...)
Substitute(list, listItem, replacementItem, ...)
Substitute(Expr(sourceExpr), Expr(findExpr), Expr(replacementExpr), ...)
Description
This is a search and replace function. It searches for a specific portion (second argument) of the source (first argument), and replaces it (third argument).
If a string, finds all matches to substring in the source string, and replaces them with the replacementString.
If a list, finds all matches to listItem in the source list, and replaces them with the replacementItem.
If an expression, finds all matches to the findExpr in the sourceExpr, and replaces them with the replacementExpr. Note that all expressions must be enclosed within an Expr() function.
Arguments
string, list, sourceExpr
A string, list, or expression in which to perform the substitution.
substring, listItem, findExpr
A string, list item, or expression to be found in the source string, list, or expression.
replacementString, replacementItem, replacementExpr
A string, list item, or expression to replace the found string, list item, or expression.
Substitute Into(string, substring, replacementString, ...)
Substitute Into(list, listItem, replacementItem, ...)
Substitute Into(Expr(sourceExpr), Expr(findExpr), Expr(replacementExpr), ...)
Description
This is a search and replace function, identical to Substitute() except in place. It searches for a specific portion (second argument) of the source (first argument), and replaces it (third argument). The first argument must be an L-value.
If a string, finds all matches to substring in the source string, and replaces them with the replacementString.
If a list, finds all matches to listItem in the source list, and replaces them with the replacementItem.
If an expression, finds all matches to the findExpr in the sourceExpr, and replaces them with the replacementExpr. Note that all expressions must be enclosed within an Expr() function.
Arguments
string, list, sourceExpr
A string, list, or expression in which to perform the substitution.
substring, listItem, findExpr
A string, list item, or expression to be found in the source string, list, or expression.
replacementString, replacementItem, replacementExpr
A string, list item, or expression to replace the found string, list item, or expression.
Words("text", <"delimiters">)
Description
Extracts the words from text according to the delimiters given. The default delimiter is space. If you include a second argument, any and all characters in that argument are taken to be delimiters.
Examples
Words( "the quick brown fox" );
{"the","quick","brown","fox"}
Words( "Doe, Jane P.",", ." );
{"Doe","Jane","P"}
MATLAB Integration Functions
JMP provides the following interfaces to access MATLAB. The basic execution model is to first initialize the MATLAB connection, perform the required MATLAB operations, and then terminate the MATLAB connection. In most cases, these functions return 0 if the MATLAB operation was successful or an error code if it was not. If the MATLAB operation is not successful, a message is written to the Log window. The single exception to this is MATLAB Get( ), which returns a value.
See the Extending JMP chapter in the Scripting Guide for details on working with MATLAB.
MATLAB JSL Function Interfaces
MATLAB Connect( <named arguments> )
Description
Initializes the MATLAB integration interfaces and returns an active MATLAB integration interface connection as a scriptable object.
Returns
MATLAB scriptable object.
Named Arguments
Echo(Boolean)
Sends the MATLAB source lines to the JMP log. The default value is true.
MATLAB Control( <named arguments> )
Description
Sends control operations to signal MATLAB with external events such as source line echoing.
Returns
None.
Arguments
None.
Named Arguments
Echo(Boolean)
Global. Echo MATLAB source lines to the JMP log.
Visible(Boolean)
Global. Determine whether to show or hide the active MATLAB workspace.
MATLAB Execute( { list of inputs }, { list of outputs }, mCode, <named arguments> )
Description
Submits the MATLAB code to the active global MATLAB connection given a list of inputs. Upon completion, retrieves a list of outputs.
Returns
0 if successful, otherwise nonzero.
Arguments
{ list of inputs }
Positional, name list. List of JMP variable names to send to MATLAB as inputs.
{ list of outputs }
Positional, name list. List of JMP variable names to retrieve from MATLAB as outputs.
mCode
Positional, string. The MATLAB code to submit.
Named Arguments
Expand(Boolean)
Perform an Eval Insert on the MATLAB code prior to submission.
Echo(Boolean)
Echo MATLAB source lines to the JMP log. Default is true.
Example
The following example sends the JMP variables x and y to MATLAB, executes the MATLAB statement z = x * y, and then gets the MATLAB variable z and returns it to JMP.
MATLAB Init();
x = [1 2 3];
y = [4 5 6];
MATLAB Execute( {x, y}, {z}, "z = x * y;" );
Show( z );
MATLAB Get( name )
Description
Gets named variable from MATLAB to JMP.
Returns
Value of named variable.
Arguments
name
Positional. The name of a JMP variable to be sent to MATLAB.
Example
Suppose that a matrix named qbx and a structure named df are present in your MATLAB connection.
// Get the MATLAB variable qbx and placed it into a JMP variable qbx.
qbx = MATLAB Get( qbx );
 
// Get the MATLAB variable df and placed it into a JMP data table referenced by df.
df = MATLAB Get( df );
Table 2.1 shows what JMP data types can be exchanged with MATLAB using the MATLAB Get( ) function. Getting lists from MATLAB recursively examines each element of the list and sends each base MATLAB data type. Nested lists are supported.
 
Table 2.1 JMP and MATLAB Equivalent Data Types for MATLAB Get( ) 
MATLAB Data Type
JMP Data Type
Double
Numeric
Logical
Numeric ( 0 | 1 )
String
String
Integer
Numeric
Date/Time
Numeric
Structure
Data Table
Matrix
Numeric Matrix
Numeric Vector
Numeric Matrix
String Vector
List of Strings
Graph
Picture object
MATLAB Get Graphics( format )
Description
Get the last graphic object written to the MATLAB graph display window in a specific graphic format. The graphic object can be returned in several graphic formats.
Returns
JMP Picture object.
Argument
format
Positional. The format the MATLAB graph display window contents are to be converted to. Valid formats are "png", "bmp", "jpeg", "jpg", "tiff", and "tif".
MATLAB Init( <named arguments> )
Description
Initializes the MATLAB integration interfaces.
Returns
Return code.
Named Arguments
Echo(Boolean) Sends MATLAB source lines to the JMP log. This option is global. The default value is true.
MATLAB Is Connected()
Description
Determines whether a MATLAB connection is active.
Returns
1 if connected, otherwise 0.
MATLAB JMP Name To MATLAB Name( name )
Description
Maps a JMP variable name to its corresponding MATLAB variable name using MATLAB variable name naming rules.
Returns
String, mapped MATLAB variable name.
Argument
name
Positional. The name of a JMP variable to be sent to MATLAB.
MATLAB Send( name, <named arguments> )
Description
Sends the named variable from JMP to MATLAB.
Returns
0 if successful, otherwise nonzero.
Arguments
name
Positional. The name of a JMP variable to be sent to MATLAB.
Named Arguments
The following optional arguments apply to data tables only:
Selected(Boolean)
Send selected rows from the referenced data table to MATLAB.
Excluded(Boolean)
Send only excluded rows from the referenced data table to MATLAB.
Labeled(Boolean)
Send only labeled rows from the referenced data table to MATLAB.
Hidden(Boolean)
Send only hidden rows from the referenced data table to MATLAB.
Colored(Boolean)
Send only colored rows from the referenced data table to MATLAB.
Markered(Boolean)
Send only markered rows from the referenced data table to MATLAB.
Row States(Boolean, <named arguments>)
Send row states from referenced data table to MATLAB by adding an additional data column named “RowState”. Create multiple selections by adding together individual settings. The row state consists of individual settings with the following values:
Selected = 1
Excluded = 2
Labeled = 4
Hidden = 8
Colored = 16
Markered = 32
The following optional, named Row States arguments are supported:
Colors(Boolean)
Send row colors. Adds additional data column named “RowStateColor”.
Markers(Boolean)
Send row markers. Adds additional data column named “RowStateMarker”.
Example
// Create a matrix, assign it to X, and send the matrix to MATLAB.
X = [1 2 3];
ml = MATLAB Send( X );
 
// Open a data table, assign a reference to it to dt, and send the data table along with its current row states to MATLAB.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
ml = MATLAB Send( dt, Row States( 1 ) );
Table 2.2 shows what JMP data types can be exchanged with MATLAB using the MATLAB Send( ) function. Sending lists to MATLAB recursively examines each element of the list and sends each base JMP data type. Nested lists are supported.
 
Table 2.2 JMP and MATLAB Equivalent Data Types for MATLAB Send( ) 
MATLAB Data Type
JMP Data Type
Double
Numeric
String
String
Double Matrix
Matrix
Structure
Data Table
Example
MATLAB Init( );
X = 1;
MATLAB Send( X );
S = "Report Title";
MATLAB Send( S );
M = [1 2 3, 4 5 6, 7 8 9];
MATLAB Send( M );
MATLAB Submit( "
X
S
M
" );
MATLAB Term( );
MATLAB Submit File( ’pathname’, <named arguments> )
Description
Submits statements to MATLAB using a file pointed to by pathname.
Returns
0 if successful, otherwise nonzero.
Arguments
Pathname
Positional, string. Pathname to file containing MATLAB source lines to be executed.
Named Arguments
Expand(Boolean)
Perform an Eval Insert on the MATLAB code prior to submission.
Echo(Boolean)
Echo MATLAB source lines to the JMP log. Default is true.
MATLAB Submit( mCode, <named arguments> )
Description
Submits the MATLAB code to the active global MATLAB connection.
Returns
0 if successful, otherwise nonzero.
Arguments
mCode
Positional, string. The MATLAB code to submit.
Named Arguments
Expand(Boolean)
Perform an Eval Insert on the MATLAB code prior to submission.
Echo(Boolean)
Echo MATLAB source lines to the JMP log. Default is true.
Example
The following example creates two vectors of random points and plots them as x and y variables.
MATLAB Init();
mc = MATLAB Submit("/[
x = rand(5);
fprintf('%f/n', x);
y = rand(5);
fprintf('%f/n', x);
z = plot(x, y);
]/" );
MATLAB Term();
Description
Terminates the currently active MATLAB integration interface.
Returns
1 if an active MATLAB connection exists, otherwise returns 0.
Arguments
None.
Matrix Functions
All(A, ...)
Returns
1 if all matrix arguments are nonzero; 0 otherwise.
Any(A, ...)
Returns
1 if one or more elements of one or more matrices are nonzero; 0 otherwise.
CDF(Y)
Description
Returns values of the empirical cumulative probability distribution function for Y, which can be a vector or a list. Cumulative probability is the proportion of data values less than or equal to the value of QuantVec.
Syntax
{QuantVec, CumProbVec} = CDF(YVec)
Chol Update(L, V, C)
Description
If L is the Cholesky root of an nxn matrix A, then after calling cholUpdate L is replaced with the Cholesky root of A+V*C*V' where C is an mxm symmetric matrix and V is an n*m matrix.
Cholesky(A)
Description
Finds the lower Cholesky root (L) of a positive semi-definitive matrix, L*L' = A.
Returns
L (the Cholesky root).
Arguments
A
a symmetric matrix.
Correlation(matrix)
Description
Calculates the correlation matrix of the data in the matrix argument.
Returns
The correlation matrix for the specified matrix.
Argument
matrix
A matrix that contains the data. If the data has m rows and n columns, the result is an m-by-m matrix.
Notes
Rows are discarded if they contain missing values.
This function uses multithreading if available, so it is recommended for large problems with many rows.
When a column is constant, the correlations for it are 0, and the diagonal element is also 0.
Covariance(matrix, < <<"Pairwise">, < <<"Shrink">, < <<Freq(vector)>, < <<Weight(vector)>)
Description
Calculates the covariance matrix of the data in the matrix argument.
Returns
The covariance matrix for the specified matrix.
Argument
matrix
A matrix that contains the data. If the data has m rows and n columns, the result is an m-by-n matrix.
"Pairwise"
Uses the pairwise method for missing values rather than the row-wise method.
"Shrink"
Performs the Schafer-Strimmer shrinkage estimate.
<<Freq(vector)
A vector that specifies frequencies for the rows of the matrix argument.
<<Weight(vector)
A vector that specifies weights for the rows of the matrix argument.
Notes
By default, rows are discarded if they contain missing values. If the "Pairwise" option is specified, all pairs of nonmissing values are used in the covariance matrix calculation.
This function uses multithreading if available, so it is recommended for large problems with many rows.
Design(vector, <levelsList | <<levels>)
Description
Creates design columns for a vector of values.
Returns
A design matrix with a column of 1s and 0s for each unique value of the argument or a list that contains the design matrix and a list of levels.
Argument
vector
a vector.
levelsList
An optional argument that is a list or matrix specifying the levels in the returned matrix.
<<levels
An optional argument that changes the return value to a list that contains the design matrix and a list of levels.
Note
Missing values in the levelsList argument are not ignored. For example:
Show( Design ( ., [. 0 1] ),
Design( 0, [. 0 1] ),
Design( 1, [. 0 1] ),
Design( [0 0 1 . 1], [. 0 1] ),
Design( {0, 0, 1, ., 1}, [. 0 1] ) );
Design(., [. 0 1]) = [1 0 0];
Design(0, [. 0 1]) = [0 1 0];
Design(1, [. 0 1]) = [0 0 1];
Design([0 0 1 . 1], [. 0 1]) =
[ 0 1 0,
0 1 0,
0 0 1,
1 0 0,
0 0 1];
Design({0, 0, 1, ., 1}, [. 0 1]) =
[ 0 1 0,
0 1 0,
0 0 1,
1 0 0,
0 0 1];
Design Nom(vector, <levelsList | <<levels>)
DesignF(vector, < <<levels >)
Description
A version of Design for making full-rank versions of design matrices for nominal effects.
Returns
A full-rank design matrix or a list that contains the design matrix and a list of levels.
Argument
vector
A vector.
levelsList
An optional argument that is a list or matrix specifying the levels in the returned matrix.
<<levels
An optional argument that changes the return value to a list that contains the design matrix and a list of levels.
Note
Missing values in the levelsList argument are not ignored. For example:
Show( Design Nom( ., [. 0 1] ),
Design Nom( 0, [. 0 1] ),
Design Nom( 1, [. 0 1] ),
Design Nom( [0 0 1 . 1], [. 0 1] ),
Design Nom( {0, 0, 1, ., 1}, [. 0 1] ) );
Design Nom(., [. 0 1]) = [1 0];
Design Nom(0, [. 0 1]) = [0 1];
Design Nom(1, [. 0 1]) = [-1 -1];
Design Nom([0 0 1 . 1], [. 0 1]) = [0 1, 0 1, -1 -1, 1 0, -1 -1];
Design Nom({0, 0, 1, ., 1}, [. 0 1]) = [0 1, 0 1, -1 -1, 1 0, -1 -1];
Design Ord(vector, <levelsList | <<levels>)
Description
A version of Design for making full-rank versions of design matrices for ordinal effects.
Returns
A full-rank design matrix or a list that contains the design matrix and a list of levels.
Argument
vector
A vector.
levelsList
An optional argument that is a list or matrix specifying the levels in the returned matrix.
<<levels
An optional argument that changes the return value to a list that contains the design matrix and a list of levels.
Note
Missing values in the levelsList argument are not ignored. For example:
Show( Design Ord( ., [. 0 1] ),
Design Ord( 0, [. 0 1] ),
Design Ord( 1, [. 0 1] ),
Design Ord( [0 0 1 . 1], [. 0 1] ),
Design Ord( {0, 0, 1, ., 1}, [. 0 1] ) );
Design Ord(., [. 0 1]) = [0 0];
Design Ord(0, [. 0 1]) = [1 0];
Design Ord(1, [. 0 1]) = [1 1];
Design Ord([0 0 1 . 1], [. 0 1]) = [1 0, 1 0, 1 1, 0 0, 1 1];
Design Ord({0, 0, 1, ., 1}, [. 0 1]) = [1 0, 1 0, 1 1, 0 0, 1 1];
DesignF()
Det(A)
Description
Determinant of a square matrix.
Returns
The determinant.
Argument
A
A square matrix.
Diag(A, <B>)
Description
Creates a diagonal matrix from a square matrix or a vector. If two matrices are provided, concatenates the matrices diagonally.
Returns
The matrix.
Argument
A
a matrix or a vector.
Direct Product(A, B)
Description
Direct (Kronecker) product of square matrices or scalars A[i,j]*B.
Returns
The product.
Arguments
A, B
Square matrices or scalars.
Distance(x1, x2, <scales>, <powers>)
Description
Produces a matrix of distances between rows of x1 and rows of x2.
Returns
A matrix.
Arguments
x1, x2
Two matrices.
scales
Optional argument to customize the scaling of the matrix.
powers
Optional argument to customize the powers of the matrix.
E Div(A, B)
A/B
Description
Element-by-element division of two matrices.
Returns
The resulting matrix.
Arguments
A, B
Two matrices.
E Mult(A, B)
A*B
Description
Element-by-element multiplication of two matrices.
Returns
The resulting matrix.
Arguments
A, B
Two matrices.
Eigen(A)
Description
Eigenvalue decomposition.
Returns
A list {M, E} such that E * Diag(M) * E = A'.
Argument
A
A symmetric matrix.
G Inverse(A)
Description
Generalized (Moore-Penrose) matrix inverse.
H Direct Product(A, B)
Description
Horizontal direct product of two square matrices of the same dimension or scalars.
Hough Line Transform(matrix, <NAngle(number)>, <NRadius(number)>)
Description
Takes a matrix of intensities and transforms it in a way that is useful for finding streaks in the matrix. Produces a matrix containing the Hough Line Transform with angles as columns and radiuses as rows.
Argument
matrix
A matrix that can be derived from the intensities of an image, but is more likely from a semiconductor wafer that may have defects across in a streak due to planarization machines.
NAngle(number)
Enter the number of the angle to obtain a different sized transform. The default is 180 degrees.
NRadius(number)
Enter the number of the radius to obtain a different sized transform. The default is sqrt(NRow*nRow+nCol*nCol).
Identity(n)
Description
Creates an n-by-n identity matrix with ones on the diagonal and zeros elsewhere.
Returns
The matrix.
Argument
n
An integer.
Index(i, j, <increment>)
i::j
Description
Creates a column matrix whose values range from i to j.
Returns
The matrix.
Arguments
i, j
Integers that define the range: i is the beginning of the range, j is the end.
increment
Optional argument to change the default increment, which is +1.
Inv()
Inv Update(A, X, 1|-1)
Description
Efficiently update an X´X matrix.
Arguments
A
The matrix to be updated.
X
One or more rows to be added to or deleted from the matrix A.
1|-1
The third argument controls whether the row or rows defined in the second argument, X, are added to or deleted from the matrix A. 1 means to add the row or rows and -1 means to delete the row or rows.
Inverse(A)
Inv(A)
Description
Returns the matrix inverse. The matrix must be square non-singular.
Is Matrix(x)
Description
Returns 1 if the evaluated argument is a matrix, or 0 otherwise.
J(nrows, <ncols>, <value>)
Description
Creates a matrix of identical values.
Returns
The matrix.
Arguments
nrows
Number of rows in matrix. If ncols is not specified, nrows is also used as ncols.
ncols
Number of columns in matrix.
value
The value used to populate the matrix. If value is not specified, 1 is used.
KDTable(matrix)
Description
Returns a table to efficiently look up near neighbors.
Returns
A KDTable object.
Argument
matrix
A matrix of k-dimensional points. The number of dimensions or points is not limited. Each column in the matrix represents a dimension to the data, and each row represents a data point.
Messages
<<Distance between rows(row1, row2)
Returns the distance between two the two specified rows in the KDTable. The distance applies to removed and inserted rows as well.
<<K nearest rows(stop, <position>)
Returns a matrix. If position is not specified, returns the n nearest rows and distances to all rows. If position is specified, returns the n nearest rows and distances to either a point or a row. Stop is either n or {n, limit}. Position is a point that is described as a row vector for the coordinate of a row, or as the number of a row.
<<Remove rows(number | vector)
Remove either the row specified by number or the rows specified by vector. Returns the number of rows that were removed. Rows that were already removed are ignored.
<<Insert rows(number | vector)
Re-insert either the row specified by number or the rows specified by vector. Returns the number of rows that were inserted. Rows that were already inserted are ignored.
Note
When rows are removed or inserted, the row indices do not change. You can remove and re-insert only rows that are in the KDTable object. If you need different rows, construct a new KDTable.
Least Squares Solve(X, y, messages)
Description
Computes optionally weighted least squares estimates.
Returns
A list that contains the matrix Beta=Inverse(X'X')X'y and the estimated variance matrix of Beta.
Arguments
<<weights(optional weight vector)
Specifies a vector of weights to perform weighted least squares.
<<method("Sweep" | "GInv")
Specifies the default Sweep method (much more computationally efficient) or a generalized inverse (GInv) method for solving the normal equations (more numerically stable).
Loc(A)
Loc(list, item)
Description
Creates a matrix of subscript positions where A is nonzero and nonmissing. For the two-argument function, Loc returns a matrix of positions where item is found within list.
Returns
The new matrix.
Argument
A
a matrix
list
a list
item
the item to be found within the list
Loc Max(A)
Description
Returns the position of the minimum element in a matrix.
Returns
An integer that is the specified position.
Argument
A
a matrix
Loc Min(A)
Description
Returns the position of the minimum element in a matrix.
Returns
An integer that is the specified position.
Argument
A
a matrix
Loc NonMissing(matrix, ..., {list}, ...)
Description
Returns indices of nonmissing rows in matrices or lists. In lists, the function can also return indices of nonempty characters.
Returns
The new matrix or list.
Loc Sorted(A, B)
Description
Creates a matrix of subscript positions where the values of A have values less than or equal to the values in B. A must be a matrix sorted in ascending order.
Returns
The new matrix.
Argument
A, B
matrices
Matrix({{x11, x12, ..., x1m}, {x21, x22, ..., 2m}, {...}, {xn1, xn2, ..., xnm}})
Description
Constructs an n-by-m matrix from a list of n lists of m row values or from the number of rows and columns.
Returns
The matrix.
Arguments
A list of lists in which each list forms a row with the specified values.
Example
mymatrix = Matrix({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}});
[ 1 2 3,
4 5 6,
7 8 9,
10 11 12]
Equivalent Expression
[x11 x12 ... x1m,
...,
xn1 xn2 ... xnm ]
Matrix Mult(A, B)
C=A*B, ...
Description
Matrix multiplication.
Arguments
Two or more matrices, which must be conformable (all matrices after the first one listed must have the same number of rows as the number of columns in the first matrix).
Note
Matrix Mult() allows only two arguments, while using the * operator enables you to multiply several matrices.
Mode(list or matrix)
Description
Selects the most frequent item from a numeric or character list or a numeric matrix. In the event of a tie, the lower value is selected. If multiple arguments are specified, a combination of numeric values and character strings is acceptable.
Arguments
Specify either a list or a matrix.
Multivariate Normal Impute(yVec, meanYvec, symCovMat)
Description
Imputes missing values in yVec based on the mean and covariance.
Arguments
yVec
The vector of responses.
meanYvec
The vector of response means.
symCovMat
A symmetric matrix containing the response covariances. If the covariance matrix is not specified, then JMP imputes with means.
NChooseK Matrix(n, k)
Description
Returns a matrix of n things taken k at a time (n select k).
N Col(x)
N Cols(x)
Description
Returns the number of columns in either a data table or a matrix.
Argument
x
Can be a data table or a matrix.
Ortho(A, <Centered(0)>, <Scaled(1)>)
Description
Orthonormalizes the columns of matrix A using the Gram Schmidt method. Centered(0) makes the columns to sum to zero. Scaled(1) makes them unit length.
Ortho Poly(vector, order)
Description
Returns orthogonal polynomials for a vector of indices representing spacings up to the order given.
Print Matrix(M, <named arguments>)
Description
Returns a string that contains a well-formatted matrix. You can use the function, for example, to print the matrix to the log.
Argument
M
A matrix.
Named Arguments
Note that the following named arguments are all optional.
<<ignore locale(Boolean)
Set to false (0) to use the decimal separator for your locale. Set to true (1) to always use a period (.) as a separator. The default value is false (0).
<<decimal digits(n)
An integer that specifies the number of digits after the decimal separator to print.
<<style("style name")
Use one of three available styles: Parseable is a reformatted JSL matrix expression. Latex is formatted for LaTex. If you specify Other, you must define the following three arguments.
<<separate("character")
Define the separator for concatenated entries.
<<line begin("character")
Define the beginning line character.
<<line end("character")
Define the ending line character.
QR(A)
Description
Returns the QR decomposition of A. Typical usage is {Q, R} = QR(A).
Rank Index(vector)
Rank(vector)
Description
Returns a vector of indices that, used as a subscript to the original vector, sorts the vector by rank. Excludes missing values. Lists of numbers or strings are supported in addition to matrices.
Ranking(vector)
Description
Returns a vector of ranks of the values of vector, low to high as 1 to n, ties arbitrary. Lists of numbers or strings are supported in addition to matrices.
Ranking Tie(vector)
Description
Returns a vector of ranks of the values of vector, but ranks for ties are averaged. Lists of numbers or strings are supported in addition to matrices.
Shape(A, nrow, <ncol>)
Description
Reshapes the matrix A across rows to the specified dimensions. Each value from the matrix A is placed row-by-row into the re-shaped matrix.
Returns
The reshaped matrix.
Arguments
A
a matrix
nrow
the number of rows that the new matrix should have.
ncol
optional. The number of columns the new matrix should have.
Notes
If ncol is not specified, the number of columns is whatever is necessary to fit all of the original values of the matrix into the reshaped matrix.
If the new matrix is smaller than the original matrix, the extra values are discarded.
If the new matrix is larger than the original matrix, the values are repeated to fill the new matrix.
Examples
a = Matrix({ {1, 2, 3}, {4, 5, 6}, {7, 8, 9} });
[ 1 2 3,
4 5 6,
7 8 9]
 
Shape(a, 2);
[ 1 2 3 4 5,
6 7 8 9 1]
 
Shape(a, 2, 2);
[ 1 2,
3 4]
 
Shape(a, 4, 4);
[ 1 2 3 4,
5 6 7 8,
9 1 2 3,
4 5 6 7]
Solve(A, b)
Description
Solves a linear system. In other words, x=inverse(A)*b.
Sort Ascending(source)
Description
Returns a copy of a list or matrix source with the items in ascending order.
Sort Descending(source)
Description
Returns a copy of a list or matrix source with the items in descending order.
Spline Coef(x, y, lambda)
Description
Returns a five column matrix of the form knots||a||b||c||d where knots is the unique values in x.
x is a vector of regressor variables, y is the vector of response variables, and lambda is the smoothing argument. Larger values for lambda result in smoother splines.
Spline Eval(x, coef)
Description
Evaluates the spline predictions using the coef matrix in the same form as returned by SplineCoef(), in other words, knots||a||b||c||d. The x argument can be a scalar or a matrix of values to predict. The number of columns of coef can be any number greater than 1 and each is used for the next higher power. The powers of x are centered at the knot values. For example, the calculation for coef of knots||a||b||c||d is j is such that knots[j] is the largest knot smaller than x.
xx = x-knots[j] is the centered x value:
result = a[j] + xx * (b[j] + xx * (c[j] + xx * d[j]))
The following line is equivalent:
result = a[j] + b[j] * xx + c[j] * xx ^ 2 + d[j] * xx ^ 3
Spline Smooth(x, y, lambda)
Description
Returns the smoothed predicted values from a spline fit.
x is a vector of regressor variables, y is the vector of response variables, and lambda is the smoothing argument. Larger values for lambda result in smoother splines.
SVD(A)
Description
Singular value decomposition.
Sweep(A, <indices>)
Description
Sweeps, or inverts a matrix a partition at a time.
Trace(A)
Description
The trace, or the sum of the diagonal elements of a square matrix.
Transpose(A)
Description
Transposes the rows and columns of the matrix A.
Returns
The transposed matrix.
Arguments
A
A matrix.
Equivalent Expression
A‘
V Concat(A, B, ...)
Description
Vertical concatenation of two or more matrices.
Returns
The new matrix.
Arguments
Two or more matrices.
V Concat To(A, B, ...)
Description
Vertical concatenation in place. This is an assignment operator.
Returns
The new matrix.
Arguments
Two or more matrices.
V Max(matrix)
Description
Returns a row vector containing the maximum of each column of matrix.
V Mean(matrix)
Description
Returns a row vector containing the mean of each column of matrix.
V Min(matrix)
Description
Returns a row vector containing the minimum of each column of matrix.
V Standardize(matrix)
Description
Returns a matrix column-standardized to mean = 0 and standard deviation = 1.
V Std(matrix)
Description
Returns a row vector containing the standard deviations of each column of matrix.
V Sum(matrix)
Description
Returns a row vector containing the sum of each column of matrix.
Varimax(matrix)
Description
Returns a list of the rotated matrix and the orthogonal rotation matrix.
Vec Diag(A)
Description
Creates a vector from the diagonals of a square matrix A.
Returns
The new matrix.
Arguments
A square matrix.
Note
Using a matrix that is not square results in an error.
Vec Quadratic(symmetric matrix, rectangular matrix)
Description
Constructs an n-by-m matrix. Used in calculation of hat values.
Returns
The new matrix.
Arguments
Two matrices. The first must be symmetric.
Equivalent Expression
Vec Diag(X*Sym*X‘)
Numeric Functions
Abs(n)
Description
Calculates the absolute value of n.
Returns
Returns a positive number of the same magnitude as the value of n.
Argument
n
Any number.
Ceiling(n)
Description
If n is not an integer, rounds n to the next highest integer.
Returns
Returns the smallest integer greater than or equal to n.
Argument
n
Any number.
Derivative(expr, {name, ...}, ...)
Description
Calculates the derivative of the expr expression with respect to name.
Returns
Returns the derivative.
Arguments
expr
Any expression. Indirect arguments (for example, Name Expr, Expr, Eval) are supported.
name
Can be a single variable or a list of variables.
Note
Adding an additional variable (Derivative(expr, name, name2)) takes the second derivative.
Floor(n)
Description
If n is not an integer, rounds n to the next lowest integer.
Returns
Returns the largest integer less than or equal to n.
Argument
n
Any number.
Examples
Floor( 2.7 );
2
Floor( –.5 );
–1
Invert Expr(expr, name)
Description
Attempts to unfold expr around name.
Mod()
Modulo(number, divisor)
Mod(number, divisor)
Description
Returns the remainder when number is divided by divisor.
Examples
Modulo( 6, 5 );
1
Normal Integrate(muVector, sigmaMatrix, expr, x, nStrata, nSim)
Description
Returns the result of radial-spherical integration for smooth functions of multivariate, normally distributed variables.
Arguments
muVector
A vector.
sigmaMatrix
A matrix.
expr
An expression in terms of the variable x.
x
The variable used in the expression expr.
nStrata
Number of strata.
nSim
Number of simulations.
Num Deriv(f(x,...), <parnum=1>)
Description
Returns the numerical derivative of the f( x,... ) function with respect to one of its arguments. You can specify that argument as the second argument in the Num Deriv function. If no second argument is specified, the derivative is taken with respect to the function's first argument. The derivative is evaluated using numeric values specified in the f( x,... ) function expression.
Num Deriv2(f(x,...))
Description
Returns the numerical second derivative of the f( x,... ) function with respect to x. The derivative is evaluated using numeric values specified in the f( x,... ) function expression.
Round(n, places)
Description
Rounds n to number of decimal places given.
Simplify Expr(expr(expression))
Simplify Expr(nameExpr(global))
Description
Algebraically simplifies an expression
Optimization Functions
Constrained Maximize(expr, {x1(low1, up1), x2(low2, up2), ...}, messages)
Description
Finds the values for the x arguments, specified as a list, that maximize the expr expression with optional linear constraints. You must specify lower and upper bounds in parentheses for each argument.
In the following messages, A is a matrix of coefficients. x = [x1, x2, ...] is the vector of arguments. b is a vector that forms the right side of the expression.
Messages
<<Less than EQ({A, b})
Sets the constraint to less than or equal to the specified values (A*x <= b).
<<Greater Than EQ({A, b})
Sets the constraint to greater than or equal to the specified values (A*x >= b).
<<Equal To({A, b})
Sets the constraint as equal to the specified values (A*x = b).
<<Starting Values([x1Start, x2Start, ...])
Specifies a starting point.
<<Max Iter(int)
An integer that specifies the maximum number of iterations to be performed.
<<Tolerance(p)
p sets the tolerance for the convergence criterion. The default tolerance is 10^5.
<<Show Details("true")
Returns a list with the final values for (objective value, number of iterations, gradient, and Hessian). Shows the step-by-step results of the optimizer in the log.
Constrained Minimize(expr, {x1(low1, up1), x2(low2, up2), ...}, messages)
Description
Finds the values for the x arguments, specified as a list, that minimize the expr expression with optional linear constraints. You must specify lower and upper bounds in parentheses for each argument.
In the following messages, A is a matrix of coefficients. x = [x1, x2, ...] is the vector of arguments. b is a vector that forms the right side of the expression.
Messages
<<Less than EQ({A, b})
Sets the constraint to less than or equal to the specified values (A*x <= b).
<<Greater Than EQ({A, b})
Sets the constraint to greater than or equal to the specified values (A*x >= b).
<<Equal To({A, b})
Sets the constraint as equal to the specified values (A*x = b).
<<Starting Values([x1Start, x2Start, ...])
Specifies a starting point.
<<Max Iter(int)
An integer that specifies the maximum number of iterations to be performed.
<<Tolerance(p)
p sets the tolerance for the convergence criterion. The default tolerance is 10^5.
<<Show Details("true")
Returns a list with the final values for (objective value, number of iterations, gradient, and Hessian). Shows the step-by-step results of the optimizer in the log.
Desirability(yVector, desireVector, y)
Description
Fits a function to go through the three points, suitable for defining the desirability of a set of response variables (y’s). yVector and desireVector are matrices with three values, corresponding to the three points defining the desirability function. The actual function depends on whether the desire values are in the shape of a larger-is-better, smaller-is-better, target, or antitarget.
Returns
The desirability function.
Arguments
yVector
Three input values.
desireVector
the corresponding three desirability values.
y
the value of which to calculate the desirability.
LPSolve(A, b, c, L, U, neq, nle, nge, <slackVars(Boolean)>)
Description
Returns a list containing the decision variables (and slack variables if applicable) in the first list item and the optimal objective function value (if one exists) in the second list item.
Arguments
A
A matrix of constraint coefficients.
b
A matrix that is a column of right hand side values of the constraints.
c
A vector of cost coefficients of the objective function.
L, U
Matrices of lower and upper bounds for the variables.
neq
The number of equality constraints.
nle
The number of less than or equal inequalities.
nge
The number of greater than or equal inequalities.
slackVars(Boolean)
Optional. Determines whether the slack variables are returned in addition to the decision variables. The default value is 0.
Note
The constraints must be listed as equalities first, less than or equal inequalities next, and greater than or equal inequalities last.
Maximize(expr, {x1(low1, up1), x2(low2, up2), ...}, messages)
Description
Finds the values for the x arguments, specified as a list, that maximize the expression expr. You can specify lower and upper bounds in parentheses for each argument. Additional arguments for the function enable you to set the maximum number of iterations, tolerance for convergence, and view more details about the optimization. The Newton-Raphson method is used when an analytical derivative is found for the Hessian. Otherwise, the Symmetric-Rank One method (SR1), a quasi-Newton method, is used.
Messages
<<Max Iter(int)
An integer that specifies the maximum number of iterations to be performed.
<<Tolerance(p)
p sets the tolerance for the convergence criterion. The default tolerance is 10^-8.
<<Show Details("true")
Returns a list with the final values for the objective value, number of iterations, gradient, and Hessian. Shows the step-by-step results of the optimizer in the log.
Minimize(expr, {x1(low1, up1), x2(low2, up2), ...}, messages)
Description
Finds the values for the x arguments, specified as a list, that minimize the expression expr. You can specify lower and upper bounds in parentheses for each argument. Additional arguments for the function enable you to set the maximum number of iterations, tolerance for convergence, and view more details about the optimization. The Newton-Raphson method is used when an analytical derivative is found for the Hessian. Otherwise, the Symmetric-Rank One method (SR1), a quasi-Newton method, is used.
Messages
<<Max Iter(int)
An integer that specifies the maximum number of iterations to be performed.
<<Tolerance(p)
p sets the tolerance for the convergence criterion. The default tolerance is 10^-8.
<<Show Details("true")
Returns a list with the final values for the objective value, number of iterations, gradient, and Hessian. Shows the step-by-step results of the optimizer in the log.
Probability Functions
Beta Density(x, alpha, beta, <theta>, <sigma>)
Description
Calculates the beta probability density function (pdf).
Returns
The density function at quantile x for the beta distribution for the given arguments.
Arguments
x
A quantile between theta and theta + sigma. Theta’s default value is 0. Sigma’s default value is 1.
alpha, beta
Shape parameters that must both be greater than 0.
theta
optional threshold. The allowable range is Equation shown here. The default is 0.
sigma
optional scale parameter, which must be greater than 0. The default is 1.
Notes
Beta Density() is useful for modeling the probabilistic behavior of random variables such as proportions constrained to fall in the interval [0, 1].
Beta Distribution(x, alpha, beta, <theta>, <sigma>)
Description
Calculates the cumulative distribution function for the beta distribution. The Beta Distribution() function is the inverse of the Beta Quantile() function.
Returns
Returns the cumulative distribution function at quantile x for the beta distribution with shape arguments alpha and beta.
Arguments
x
A quantile between theta and theta + sigma.
alpha, beta
Shape parameters that must both be greater than 0.
theta
optional threshold. The allowable range is Equation shown here. The default is 0.
sigma
optional scale parameter, which must be greater than 0. The default is 1.
Beta Quantile(p, alpha, beta, <theta>, <sigma>)
Description
Calculates the requested quantile for the beta distribution. The Beta Quantile() function is the inverse of the Beta Distribution() function.
Returns
Returns the pth quantile from the beta distribution with shape arguments alpha and beta.
Arguments
p
The probability of the quantile desired; p must be between 0 and 1.
alpha, beta
Shape parameters that must both be greater than 0.
theta
optional threshold. The allowable range is Equation shown here. The default is 0.
sigma
optional scale parameter, which must be greater than 0. The default is 1.
Cauchy Density(q, <center>, <scale>)
Description
Returns the density at q of a Cauchy distribution with center mu and scale sigma.
Cauchy Distribution(q, <center>, <scale>)
Description
Returns the probability that a Cauchy distributed random variable is less than q.
Cauchy Quantile(p, <center>, <scale>)
Description
Returns the quantile from a Cauchy distribution, the value for which the probability is p that a random value would be lower.
ChiSquare Density(q, df, <center>)
Description
The chi-square density at q of the chi-square with df degrees of freedom and optional non-centrality parameter center.
Returns
The chi-square density.
Arguments
q
quantile
df
degrees of freedom.
center
non-centrality parameter
ChiSquare Distribution(q, df, <center>)
Description
Returns cumulative distribution function at quantile x for chi-square with df degrees of freedom centered at center.
ChiSquare Log CDistribution(x, df, <nc>)
Description
Returns 1 - log (value) of the distribution function at quantile x for the chi-square distribution.
ChiSquare Log Density(x, df, <nc>)
Description
Returns the log of the value of the density function at quantile x for the chi-square distribution
ChiSquare Log Distribution(x, df, <nc>)
Description
Returns the log of the value of the distribution function at quantile x for the chi-square distribution.
ChiSquare Noncentrality(x, df, prob)
Description
Solves the noncentrality such that prob=ChiSquare Distribution (x, df, nc)
ChiSquare Quantile(q, df, <center>)
Description
Returns the pth quantile from the chi-square distribution with df degrees of freedom, centered at center.
Dunnett P Value(q, nTrt, dfe, lambdaVec)
Description
Returns the p-value from Dunnett’s multiple comparisons test.
Returns
A number that is the p-value.
Arguments
q
A number that is the test statistic.
nTrt
The number of treatments being compared to the control treatment.
dfe
The error degrees of freedom.
lambdaVec
A vector of parameters. If lambdaVec is missing (.), the parameters are set to 1/Sqrt(2).
Dunnett Quantile(1-alpha, nTrt, dfe, lambdaVec)
Description
Returns quantile needed in from Dunnett’s multiple comparisons test.
Returns
A number that is the quantile.
Arguments
1-alpha
A number that is the confidence level.
nTrt
The number of treatments being compared to the control treatment.
dfe
The error degrees of freedom.
lambdaVec
A vector of parameters. If lambdaVec is missing (.), the parameters are set to 1/Sqrt(2).
F Density(x, dfnum, dfden, <center>)
Description
Returns the F density at x for the F distribution with numerator and denominator degrees of freedom dfnum and dfden, with optional noncentrality parameter center.
F Distribution(x, dfnum, dfden, <center>)
Description
Returns cumulative distribution function at quantile x for F distribution with numerator and denominator degrees of freedom dfnum and dfden and noncentrality parameter center.
F Log CDistribution(x, dfn, dfd, <nc>)
Description
Returns 1 - log (value) of the normal distribution function at quantile x for the F distribution.
F Log Density(x, dfn, dfd, <nc>)
Description
Returns the log of the value of the density function at quantile x for the F distribution.
F Log Distribution(x, dfn, dfd, <nc>)
Description
Returns the log of the value of the distribution function at quantile x for the F distribution.
F Noncentrality(x, ndf, ddf, prob)
Description
Solves the noncentrality such that prob=F Distribution (x, ndf, ddf, nc)
F Power(alpha, dfh, dfm, d, n)
Description
Calculates the power from a given situation involving an F test or a t test.
F Quantile(x, dfnum, dfden, <center>)
Description
Returns the pth quantile from the F distribution with numerator and denominator degrees of freedom dfnum and dfden and noncentrality parameter center.
F Sample Size(alpha, dfh, dfm, d, power)
Description
Calculates the sample size from a given situation involving an F test or a t test.
Frechet Density(x, mu, sigma)
Description
Returns the density at x of a Frechet distribution with location mu and scale sigma.
Arguments
x
A number.
mu
A location.
sigma
The scale.
Frechet Distribution(x, mu, sigma)
Description
Returns the probability that the Fréchet distribution with location mu and scale sigma is less than x.
Arguments
x
A number.
mu
A location.
sigma
The scale.
Frechet Quantile(p, mu, sigma)
Description
Returns the quantile associated with a cumulative probability p for a Fréchet distribution with location mu and scale sigma.
Arguments
p
The probability of the quantile desired; p must be between 0 and 1.
mu
A location.
sigma
The scale.
Gamma Density(q, alpha, <scale>, <threshold>)
Description
Calculates the density at q of a Gamma probability distribution.
Returns
The density function at quantile q for the gamma density distribution for the given arguments.
Arguments
q
A quantile.
alpha
Shape parameters that must be greater than 1.
scale
Optional scale, which must be greater than 0. The default is 1.
threshold
Optional threshold parameter. The allowable range is Equation shown here. The default is 0.
Gamma Distribution(x, <shape, scale, threshold>)
IGamma(x, <shape, scale, threshold>)
Description
Returns cumulative distribution function at quantile x for the gamma distribution with shape, scale, and threshold given.
Gamma Log CDistribution(x, alpha, <scale = 1>, <threshold = 0>)
Description
Same as Log (1 – Gamma Distribution(x, alpha)) except that it has a much greater range.
Gamma Log Density(x, alpha, <scale = 1>, <threshold = 0>)
Description
Same as Log(Gamma Density(x, alpha)) except that it has a much greater range.
Gamma Log Distribution(x, alpha, <scale = 1>, <threshold = 0>)
Description
Same as Log(Gamma Distribution(x, alpha)) except that it has a much greater range.
Gamma Quantile(p, <shape, scale, threshold>)
Description
Returns the pth quantile from the gamma distribution with the shape, scale, and threshold parameters given.
GenGamma Density(x, mu, sigma, lambda)
Description
Returns the density at x of an extended generalized gamma probability distribution with parameters mu, sigma, and lambda.
GenGamma Distribution(x, mu, sigma, lambda)
Description
Returns the probability that an extended generalized gamma distributed random variable (with parameters mu, sigma, and lambda) is less than x.
GenGamma Quantile(p, mu, sigma, lambda)
Description
Returns the quantile from an extended generalized gamma distribution (with parameters mu, sigma, and lambda), the value for which the probability is p that a random value would be lower.
GLog Density(q, mu, sigma, lambda)
Description
Returns the density at q of a generalized logarithmic distribution with location mu, scale sigma, and shape lambda.
GLog Distribution(q, mu, sigma, lambda)
Description
Returns the probability that a generalized logarithmically distribution random variable is less than q.
GLog Quantile(p, mu, sigma, lambda)
Description
Returns the quantile for whose value the probability is p that a random value would be lower.
IGamma()
Johnson Sb Density(q, gamma, delta, theta, sigma)
Description
Returns the density at q of a Johnson Sb distribution.
Arguments
q
A value that is in the interval theta to theta + sigma.
gamma
Shape parameter that can be any value.
delta
Shape parameter that must be greater than 0.
theta
Location parameter that can be any value.
sigma
Scale parameter that must be greater than 0.
Johnson Sb Distribution(q, gamma, delta, theta, sigma)
Description
Returns the probability that a Johnson Sb-distributed random variable is less than q.
Arguments
q
A value that is in the interval theta to theta + sigma.
gamma
Shape parameter that can be any value.
delta
Shape parameter that must be greater than 0.
theta
Location parameter that can be any value.
sigma
Scale parameter that must be greater than 0.
Johnson Sb Quantile(p, gamma, delta, theta, sigma)
Description
Returns the quantile whose value for which the probability is p that a random value would be lower.
Arguments
p
The probability of the quantile desired; p must be between 0 and 1.
gamma
Shape parameter that can be any value.
delta
Shape parameter that must be greater than 0.
theta
Location parameter that can be any value.
sigma
Scale parameter that must be greater than 0.
Johnson Sl Density(q, gamma, delta, theta, sigma)
Description
Returns the density at q of a Johnson Sl distribution.
Arguments
q
A value that is in the interval theta to +infinity.
gamma
Shape parameter that can be any value.
delta
Shape parameter that must be greater than 0.
theta
Location parameter that can be any value.
sigma
Parameter that defines if the distribution is skewed positively or negatively. Sigma must be equal to either +1 (skewed positively) or -1 (skewed negatively).
Johnson Sl Distribution(q, gamma, delta, theta, sigma)
Description
Returns the probability that a Johnson Sl-distributed random variable is less than q.
Arguments
q
A value that is in the interval theta to +infinity.
gamma
Shape parameter that can be any value.
delta
Shape parameter that must be greater than 0.
theta
Location parameter that can be any value.
sigma
Parameter that defines if the distribution is skewed positively or negatively. Sigma must be equal to either +1 (skewed positively) or -1 (skewed negatively).
Johnson Sl Quantile(p, gamma, delta, theta, sigma)
Description
Returns the quantile whose value for which the probability is p that a random value would be lower.
Arguments
p
The probability of the quantile desired; p must be between 0 and 1.
gamma
Shape parameter that can be any value.
delta
Shape parameter that must be greater than 0.
theta
Location parameter that can be any value.
sigma
Parameter that defines if the distribution is skewed positively or negatively. Sigma must be equal to either +1 (skewed positively) or -1 (skewed negatively).
Johnson Su Density(q, gamma, delta, theta, sigma)
Description
Returns the density at q of a Johnson Su distribution.
Arguments
q
A value that is between -infinity and +infinity.
gamma
Shape parameter that can be any value.
delta
Shape parameter that must be greater than 0.
theta
Location parameter that can be any value.
sigma
Scale parameter that must be greater than 0.
Johnson Su Distribution(q, gamma, delta, theta, sigma)
Description
Returns the probability that a Johnson Su-distributed random variable is less than q.
Arguments
q
A value that is between -infinity and +infinity.
gamma
Shape parameter that can be any value.
delta
Shape parameter that must be greater than 0.
theta
Location parameter that can be any value.
sigma
Scale parameter that must be greater than 0.
Johnson Su Quantile(p, gamma, delta, theta, sigma)
Description
Returns the quantile whose value for which the probability is p that a random value would be lower.
Arguments
p
The probability of the quantile desired; p must be between 0 and 1.
gamma
Shape parameter that can be any value.
delta
Shape parameter that must be greater than 0.
theta
Location parameter that can be any value.
sigma
Scale parameter that must be greater than 0.
LEV Density(x, mu, sigma)
Description
Returns the density at x of the largest extreme value distribution with location mu and scale sigma.
LEV Distribution(x, mu, sigma)
Description
Returns the probability that the largest extreme value distribution with location mu and scale sigma is less than x.
LEV Quantile(p, mu, sigma)
Description
Returns the quantile associated with a cumulative probability p of the largest extreme value distribution with location mu and scale sigma.
LogGenGamma Density(x, mu, sigma, lambda)
Description
Returns the density at x of a log generalized gamma probability distribution with parameters mu, sigma, and lambda.
LogGenGamma Distribution(x, mu, sigma, lambda)
Description
Returns the probability that a log generalized gamma distributed random variable (with parameters mu, sigma, and lambda) is less than x.
LogGenGamma Quantile(p, mu, sigma, lambda)
Description
Returns the quantile from a log generalized gamma distribution (with parameters mu, sigma, and lambda), the value for which the probability is p that a random variable would be lower.
Logistic Density(x, mu, sigma)
Description
Returns the density at x of a logistic distribution with location mu and scale sigma.
Logistic Distribution(x, mu, sigma)
Description
Returns the probability that the logistic distribution with location mu and scale sigma is less than x.
Logistic Quantile(x, mu, sigma)
Description
Returns the quantile associated with a cumulative probability p of the logistic distribution with location mu and scale sigma.
Loglogistic Density(x, mu, sigma)
Description
Returns the density at x of a loglogistic distribution with location mu and scale sigma.
Loglogistic Distribution(x, mu, sigma)
Description
Returns the probability that the loglogistic distribution with location mu and scale sigma is less than x.
Loglogistic Quantile(x, mu, sigma)
Description
Returns the quantile associated with a cumulative probability p of the loglogistic distribution with location mu and scale sigma.
Lognormal Density(x, mu, sigma)
Description
Returns the density at x of a lognormal distribution with location mu and scale sigma.
Lognormal Distribution(x, mu, sigma)
Description
Returns the probability at x of a lognormal distribution with location mu and scale sigma.
Lognormal Quantile(x, mu, sigma)
Description
Returns the quantile at p of a lognormal distribution with location mu and scale sigma.
Normal Biv Distribution(x, y, r, <mu1>, <s1>, <mu2>, <s2>)
Description
Computes the probability that an observation (X, Y) is less than or equal to (x, y) with correlation coefficient r where X is individually normally distributed with mean mu1 and standard deviation s1 and Y is individually normally distributed with mean mu2 and standard deviation s2. If mu1, s1, mu2, and s2 are not given, the function assumes the standard normal bivariate distribution with mu1=0, s1=1, mu2=0, and s2=1.
Normal Density(x, <mean>, <stddev>)
Description
Returns the value of the density function at quantile x for the normal distribution with mean and stddev. The default mean is 0; the default stddev is 1.
Normal Distribution(x, <mean>, <stddev>)
Description
Returns the cumulative distribution function at quantile x for the normal distribution with mean and stddev. The default mean is 0. the default stddev is 1.
Normal Log CDistribution(x)
Description
Returns 1 - log (value) of the distribution function at quantile x for the normal distribution.
Normal Log Density(x)
Description
Returns the log of the value of the density function at quantile x for the normal distribution.
Normal Log Distribution(x)
Description
Returns the log of the value of the distribution function at quantile x for the normal distribution.
Normal Mixture Density(q, mean, stdev, probability)
Description
Returns the density at q of a normal mixture distribution with group means mean, group standard deviations stdev, and group probabilities probability. The mean, stdev, and probability arguments are all vectors of the same size.
Normal Mixture Distribution(q, mean, stdev, probability)
Description
Returns the probability that a normal mixture distributed variable with group means mean, group standard deviations stdev, and group probabilities probability is less than q. The mean, stdev, and probability arguments are all vectors of the same size.
Normal Mixture Quantile(p, mean, stdev, probability)
Description
Returns the quantile, the values for which the probability is p that a random value would be lower. The mean, stdev, and probability arguments are all vectors of the same size.
Normal Quantile(p, <mean>, <stddev>)
Probit(p, <mean>, <stddev>)
Description
Returns the pth quantile from the normal distribution with mean and stddev. The default mean is 0. the default stddev is 1.
Probit()
SEV Density(x, mu, sigma)
Description
Returns the density at x of the smallest extreme distribution with location mu and scale sigma.
SEV Distribution(x, mu, sigma)
Description
Returns the probability that the smallest extreme distribution with location mu and scale sigma is less than x.
SEV Quantile(p, mu, sigma)
Description
Returns the quantile at p of the smallest extreme distribution with location mu and scale sigma.
Students t Density()
Students t Distribution()
Students t Quantile()
t Density(q, df)
Students t Density(q, df)
Description
Returns the value of the density function at quantile x for the Student’s t distribution with degrees of freedom df.
t Distribution(q, df, <nonCentrality>)
Students t Distribution(q, df, <nonCentrality>)
Description
Returns the probability that a Student’s t distributed random variable is less than q. NonCentrality defaults to 0.
t Log CDistribution(x, df, <nc>)
Description
Returns 1 - log (value) of the normal distribution function at quantile x for the t distribution.
t Log Density(x, df, <nc>)
Description
Returns the log of the value of the density function at quantile x for the t distribution.
t Log Distribution(x, df, <nc>)
Description
Returns the log of the value of the distribution function at quantile x for the t distribution.
t Noncentrality(x, df, prob)
Description
Solves the noncentrality such that
prob=T Distribution (x, df, nc)
t Quantile(p, df, <nonCentrality>)
Students t Quantile(p, df, <nonCentrality>)
Description
Returns the pth quantile from the Student’s t distribution with degrees of freedom df. NonCentrality defaults to 0.
Tukey HSD P Value(q, n, dfe)
Description
Returns the p-value from Tukey’s HSD multiple comparisons test.
Arguments
q
The test statistic.
n
The number of groups in the study.
dfe
The error degrees of freedom, based on the total study sample.
Tukey HSD Quantile(1-alpha, n, dfe)
Description
Returns the quantile needed in Tukey’s HSD multiple comparisons test.
Arguments
1-alpha
The confidence level.
n
The number of groups in the study.
dfe
The error degrees of freedom, based on the total study sample.
Weibull Density(x, shape, <scale, threshold>)
Description
Returns the value of the density function at quantile x for the Weibull distribution with the parameters given.
Weibull Distribution(x, shape, <scale, threshold>)
Description
Returns the cumulative distribution function at quantile x for the Weibull distribution with the parameters given.
Weibull Quantile(p, shape, <scale, threshold>)
Description
Returns the pth quantile from the Weibull distribution with the parameters given.
Programming Functions
As Column(name)
As Column(dt, name)
:name
dt:name
Description
This scoping operator forces name to be evaluated as a data table column in the current data table (or the table given by the optional data table reference argument, dt) rather than as a global variable.
Arguments
name
Variable name.
dt
The data table reference
Note
:name refers to a column name in the current data table. You can also specify which data table to refer to by use dt:name.
As Constant(expr)
Description
Evaluates an expression once to create a value that does not change after it is computed.
Returns
The result of the evaluation.
Argument
expr
Any JSL expression.
Notes
A few platforms that can save prediction columns to a data table use As Constant(). The function is wrapped around the part of the formula that is constant across all rows. The argument is evaluated for the first row and then the result is used without re-evaluation for subsequent rows.
As Global( name)
:: name
Description
This scoping operator forces name to be evaluated as a global variable rather than as a data table column.
Arguments
name
Variable name.
As List(matrix)
As Name(string)
Description
Evaluates argument as a string and changes it into a name.
Returns
A name.
As Namespace(name)
Description
Accesses the specified namespace. An error is thrown if no such namespace exists.
Returns
The namespace.
Arguments
name
Unquoted name of a defined namespace.
As Scoped(namespace, variable)
namespace:variable
Description
Accesses the specified variable within the specified namespace.
Returns
The value of the variable, or an error the scoped variable is not found.
Arguments
namespace
The name of a defined namespace.
variable
A variable defined within namespace.
Associative Array({key, value}, ...)
Associative Array(keys, values)
Description
Creates an associative array (also known as a dictionary or hash map).
Returns
An associative array object.
Arguments
Either list of key-value pairs; or a list, matrix, or data table column that contains keys followed by a list, matrix, or data table column, respectively, that contains the corresponding values.
Clear Globals(<name>, <name>, ...)
Description
Clears the values for all global symbols. Symbols in any scope other than global are not affected. If one or more names are specified, only those global symbols are cleared.
Returns
Null.
Arguments
name
Optional: any global variable name(s).
See
Clear Log()
Description
Empties the log.
Clear Symbols(<name>, <name>, ...)
Description
Clear the values for all symbols in any and all scopes. If one or more names are specified, only those symbols are cleared.
Returns
Null.
Arguments
name
Optional: any global variable name(s).
See
Close Log()
Description
Closes the log.
Delete Globals(<name>, <name>, ...)
Description
Deletes all global symbols, except global symbols that are locked. Symbols in any scope other than global are not affected. If one or more names are specified, only those global symbols are cleared.
Arguments
name
Optional: any global variable name(s).
See
Delete Symbols(<name>, <name>, ...)
Description
Deletes all symbols in any and all scopes. If one or more names are specified, only those symbols are deleted.
Arguments
name
Optional: any global variable name(s).
See
Eval(expr)
Description
Evaluates expr, and then evaluates the result of expr (unquoting).
Returns
The result of the evaluation.
Argument
expr
Any JSL expression.
Eval Insert(string, <startDel>, <endDel>, < <<Use Locale(1) >)
Description
Allows for multiple substitutions.
Returns
The result.
Arguments
string
A quoted string with embedded expressions.
startDel
Optional starting delimiter. The default value is ^.
endDel
optional ending delimited. The default value is the starting delimiter.
Use Locale(1)
Optional argument that preserves locale-specific numeric formatting.
Eval Insert Into(string, <startDel>, <endDel>)
Description
Allows for multiple substitutions in place. The same operation as in Eval Insert is performed, and the result is placed into string.
Returns
The result.
Arguments
string
A string variable that contains a string with embedded expressions.
startDel
Optional starting delimiter. The default value is ^.
endDel
optional ending delimited. The default value is the starting delimiter.
Eval List
Exit(<NoSave>)
Quit(<NoSave>)
Description
Exits JMP.
Returns
Void.
Arguments
NoSave
Optional, named command; exits JMP without prompting to save any open files. This command is not case-sensitive, and spaces are optional.
First(expr, <expr>, ...)
Description
Evaluates all expressions provided as arguments.
Returns
Only the result of the first evaluated expression.
Arguments
expr
Any valid JSL expression.
Function({arguments}, <{local variables}>, <Return(<expr>)>, script)
Description
Stores the body script with arguments as local variables.
Returns
The function as defined. If the Return() argument is specified, the expression is returned.
When called later, it returns the result of the script given the specified arguments.
Arguments
{arguments}
A list of arguments to pass into the function. You can specify some arguments as optional or required.
{local variables}
A list of variables that are local to the function. You can declare local variables in three ways:
{var1, var2}
{var1=0, var1="a string"}
{Default Local}
The last option declares that all unscoped variables used in the function are local to the function.
Return(expr)
This optional argument returns an expression from an user defined function. If a null expression is used, a period, “.”, is returned.
script
Any valid JSL script.
Get Environment Variable("variable")
Description
Retrieves the value of an operating system environment variable.
Returns
A string that contains the value of the specified environment variable. If the specified variable is not found, an empty string is returned.
Arguments
"variable"
A string that contains the name of an environment variable.
Notes
On Macintosh, environment variable names are case-sensitive. On Windows, the names are case-insensitive.
Get Log(<n>)
Description
Returns a list of lines from the log.
Returns
A list of strings. Each string contains one line from the log.
Argument
n
Optional, integer. If no argument is specified, all the lines are returned. If a positive number is specified, the first n lines are returned. If a negative number is specified, the last n lines are returned. If n=0, no lines are returned (an empty list). If the log is empty, an empty list is returned.
Include("pathname", <named arguments>)
Description
Opens the script file identified by the quoted string pathname, parses the script in it, and executes it.
Returns
Whatever the included script returns. If you use the <<Parse Only option, Include returns the contents of the script.
Named Arguments
<<Parse Only
Parses the script but does not execute the script.
<<New Context
Causes the included script to be run its own unique namespace. When the parent and included scripts use the global namespace, include <<Names Default to Here along with <<New Context.
<<Allow Include File Recursion
Lets the included script include itself.
Example
::x = 5;
Show Symbols(); // x = 5;
Include( "$SAMPLE_SCRIPTS/scriptInclude.jsl", <<New Context, <<Names Default To Here);
Show Symbols();
The resultant value of x becomes 1, because myfile.jsl sets x to 1.
Include File List()
Description
Returns a list of files that are included at the point of execution.
Is Log Open()
Description
Returns result if log window is open.
List
Local({name=value, ...}, script)
Description
Resolves names to local expressions.
Local Here(expression)
Description
Creates a local Here namespace block. Use this function to prevent name collisions when multiple scripts are executed from the same root namespace (for example, when a script executes two button scripts that have the same variables). The argument can be any valid JSL expression.
Lock Globals(name1, name2, ...)
Description
Locks one or more global variables to prevent it or them from being changed.
Lock Symbols(<name>, <name>, ...)
Description
Locks the specified symbols, which prevents them from being modified or cleared. If no symbols are provided, all global symbols are locked. If no symbols are provided and the script has the Names Default To Here mode turned on, then all local symbols are locked.
LogCapture(expr)
Description
Evaluates the expr, captures the output that would normally be sent to the log, and instead returns it.
Returns
A string that contains the log output.
Argument
Any valid JSL expression.
Note
No output appears in the log.
N Items
Names Default To Here(Boolean)
Description
Determines where unresolved names are stored, either as a global or local (if Boolean is 0) or in the Here scope (if Boolean is 1).
Namespace(name)
Description
Returns a reference to the named namespace (name).
Argument
Name
A namespace name string or a reference to a namespace.
Namespace Exists(name)
Description
Returns 1 if a namespace with the specified name exists; otherwise, returns 0.
New Namespace(<"name">, <{expr, ...}>)
Description
Creates a new namespace with the specified name. If a name is not provided, an anonymous name is provided.
Returns
A reference to the namespace.
Arguments
name
An optional, quoted string that contains the name of the new namespace.
{list of expressions}
An optional list of expressions within the namespace.
Open Log()
Description
Opens the log. Include the Boolean argument (1) to make the window active, even if it is already open.
Parameter({name=value, ...}, model expression)
Description
Defines formula parameters for models for the Nonlinear platform.
Parse(string)
Description
Converts a character string into a JSL expression.
Print(expr, expr, ...)
Description
Prints the values of the specified expressions to the log.
Quit()
Recurse(function)
Description
Makes a recursive call of the defining function.
Save Log(pathname)
Description
Writes the contents of the log to the specified file location.
Send(obj, message)
obj << message
Description
Sends a message to a platform object.
Set Environment Variable( "variable", <"value">)
Description
Sets the environment variable to the value specified. If the “value” argument is missing or is an empty string, then the environment variable is deleted from the JMP process environment variable table.
Show(expr, expr, ...)
Description
Prints the name and value of each expression to the log.
Show Globals()
Description
Shows the values for all global symbols. Symbols in any scope other than global are not shown.
See
Show Namespaces()
Description
Shows the contents of all user-defined namespaces, both named and anonymous.
Show Symbols()
Description
Shows the values for all symbols in any and all scopes.
See
Sort List
Sort List Into
Throw("text")
Description
Returns a Throw. If you include text, throwing stores text in a global exception_msg. If text begins with “!”, throwing creates an error message about where the exception was caught.
Try(expr1, expr2)
Description
Evaluates expr1. If the evaluation returns a Throw, execution stops, and nothing is returned. expr2 is evaluated next to return the result.
Examples
Try( Sqrt( "s" ), "invalid" );
"invalid"
 
Try( Sqrt( "s" ), exception_msg );
{"Cannot convert argument to a number [or matrix]"(1, 2, "Sqrt", Sqrt/*###*/("s"))}
Note
Expr2 can be a character string or the global exception message (exception_msg) that contains more information about the error returned.
Type(x)
Description
Returns a string that names the type of object x is. The list of possible types is: Unknown, List, DisplayBox, Picture, Column, TableVar, Table, Empty, Pattern, Date, Integer, Number, String, Name, Matrix, RowState, Expression, Associative Array, Blob.
Unlock Symbols(name1, name2, ...)
Unlock Globals(name1, name2, ...)
Description
Unlocks the specified symbols that were locked with a Lock Symbols() or Lock Globals() command.
Wait(n)
Description
Pauses n seconds before continuing the script.
Watch(all | name1, ...)
Description
Shows variables (global, local, and variables within namespaces) and their values in a window. If “all” is provided as the argument, all globals are placed into the window.
Note
New globals are not added to the window list.
Watching associative arrays that have been modified using messages is not supported.
Wild()
Description
Only used with Extract Expr() for expression matching to denote a wildcard position that matches any expression.
Wild List()
Description
Only used with Extract Expr() for expression matching to denote a series of wildcard arguments that match any expression.
Write("text")
Description
Prints text to the log without surrounding quotation marks.
R Integration Functions
R Connect( <named_arguments> )
Description
Returns the current R connection object. If there is no connection to R, it intializes the R integration interfaces and returns an active R integration interface connection as a scriptable object.
Returns
R scriptable object.
Arguments
Echo(Boolean)
Optional. Sends all source lines to the JMP log. This option is global. The default value is true.
R Execute( { list of inputs }, { list of outputs }, "rCode", <named_arguments> )
Description
Submit the specified R code to the active global R connection given a list of inputs. On completion, the outputs are returned into the specified list.
Returns
0 if successful; nonzero otherwise.
Arguments
{ list of inputs }
A list of JMP variable names to be sent to R as inputs.
{ list of outputs }
A list of JMP variable names to contain the outputs returned from R.
rCode
A quoted string that contains the R code to submit.
Expand(Boolean)
An optional, Boolean, named argument. Performs an Eval Insert() on the R code before submitting to R.
Echo(Boolean)
An optional, Boolean, named argument. Sends all source lines to the JMP log. This option is global. The default value is true.
Example
Send the JMP variables x and y to R, execute the R statement z <- x * y, and then get the R variable z and return it to JMP.
x = [1 2 3];
y = [4 5 6];
rc = R Execute( {x, y}, {z}, "z <- x * y" );
R Get( variable_name )
Description
Gets the named variable from R to JMP.
Returns
The value of the named variable.
Argument
name
Required. The name of an R variable whose value to return to JMP.
Example
Assume that a matrix named qbx and a data frame named df are present in your R connection.
// Get the R variable qbx and placed it into a JMP variable qbx
qbx = R Get( qbx );
 
// Get the R variable df and placed it into a JMP data table referenced by df
df = R Get( df );
R Get Graphics( "format" )
Description
Gets the last graphics object written to the R graph display window in the specified format.
Returns
A JMP picture object.
Argument
format
Required. Specifies the graphics format to be used. The valid formats are "png", "bmp", "jpeg", "jpg", "tiff", and "tif".
R Init( named_arguments )
Description
Initializes the R session.
Returns
0 if the initialization is successful; any nonzero value otherwise.
Argument
Echo(Boolean)
Optional. Sends all source lines to the JMP log. This option is global. The default value is true.
R Is Connected()
Description
Determines whether a connection to R exists.
Returns
1 if connected; 0 otherwise.
Arguments
None.
R JMP Name to R Name( name )
Description
Maps the specified JMP variable name to the corresponding R variable name using R naming rules.
Argument
name
The name of a JMP variable to be sent to R.
Returns
A string that contains the R name.
R Send( name, <R Name( name )>)
Description
Sends named variables from JMP to R.
Returns
0 if the send is successful; any nonzero value otherwise.
Arguments
name
required. The name of a JMP variable to be sent to R.
R Name(name)
Optional. You can give the variable that you send to R a different name. For example
R Send(Here:x, R Name("localx"))
For data tables only:
Selected(Boolean)
optional, named, Boolean. Send only selected rows from the referenced data table to R.
Excluded(Boolean)
optional, named, Boolean. Send only excluded rows from the referenced data table to R.
Labeled(Boolean)
optional, named, Boolean. Send only labeled rows from the referenced data table to R.
Hidden(Boolean)
optional, named, Boolean. Send only hidden rows from the referenced data table to R.
Colored(Boolean)
optional, named, Boolean. Send only colored rows from the referenced data table to R.
Markered(Boolean)
optional, named, Boolean. Send only markered rows from the referenced data table to R.
Row States(Boolean, <named arguments>)
optional, named. Includes a Boolean argument and optional named arguments. Send row state information from the referenced data table to R by adding an additional data column named “RowState”. Multiple row states are created by adding together individual settings. The individual values are as follows:
Selected = 1
Excluded = 2
Hidden = 4
Labeled = 8
Colored = 16
Markered = 32
The named arguments for the Row States() argument are as follows:
Colors(Boolean)
optional, named, Boolean. Sends row colors. Adds additional data column named “RowStateColor”.
Markers(Boolean)
optional, named, Boolean. Sends row markers. Adds additional data column named “RowStateMarker”.
Examples
Create a matrix, assign it to X, and send the matrix to R:
X = [1 2 3];
rc = R Send( X );
Open a data table, assign a reference to it (dt), and send the data table, along with its current row states, to R:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
rc = R Send( dt, Row States(1) );
R Send File( "pathname", <R Name("name")>)
Description
Sends the specified data file from JMP to R.
Returns
0 if the send is successful; any nonzero value otherwise.
Arguments
pathname
required. A quoted string that contains a pathname for a file.
R Name(name)
Optional. You can give the data file that you send to R a different name.
R Submit( "rCode", <named_arguments> )
Description
Submits the specified R code to the active global R connection.
Returns
0 if successful; nonzero otherwise.
Arguments
rCode
A required, quoted string that contains the R code to submit.
Expand(Boolean)
An optional, Boolean, named argument. Performs an Eval Insert() on the R code before submitting to R.
Echo(Boolean)
An optional, Boolean, named argument. Sends all source lines to the JMP log. This option is global. The default value is true.
Async(Boolean)
An optional, Boolean, named argument. If set to true (1), the submit can be canceled either by pressing the ESCAPE key, or by using this message to an R connection: rconn<<Control( Interrupt( 1 ) ). False (0) is the default value.
Example
rc = R Submit("/[
x <- rnorm(5)
print(x)
y <- rnorm(5)
print(y)
z = plot(x, y)
]/" );
R Submit File( "pathname" )
Description
Submits statements to R using a file pointed in the specified pathname.
Returns
0 if successful; nonzero otherwise.
Argument
Pathname
A quoted string that contains the pathname to the file that contains the R code to be executed.
R Term()
Description
Terminates the currently active R integration interface
Returns
1 if an active R connection exists; otherwise 0.
Arguments
None
Random Functions
Col Shuffle()
Description
Shuffles the values randomly each time it’s evaluated.
Returns
The last value placed into the last row.
Argument
none
Example
For Each Row(x=:shuffle = colshuffle());
show(x)
x = 6
In a table with 40 rows, the above script places the values 1-40 randomly into each row of the column named shuffle. All numbers appear only once. Each time the script is run, the numbers are placed in a different random order. If the value placed into the row 40 of column shuffle is 6, that number is assigned to x, as in the above example.
Random Beta(alpha, beta, <theta>, <sigma>)
Description
Generates a pseudo-random number from a beta distribution using two shape parameters, alpha and beta. Optionally generates the lower threshold parameter, theta, and the scale parameter, sigma. The default values are theta = 0 and sigma = 1.
Random Beta Binomial(n, p, <delta>)
Description
Returns a random number from a beta binomial distribution for n trials with probability p and correlation delta. The default value for delta is 0.
Random Binomial(n, p)
Description
Returns random numbers from a binomial distribution with n trials and probability p of the event of interest occurring.
Random Category(probA, resultA, ProbB, resultB, resultElse)
Description
Returns a random category given an alternation of probability and result expressions.
Random Cauchy(<alpha>, <beta>)
Description
Returns a Cauchy distribution with given alpha (location) and beta (scale).
Random ChiSquare(df, <noncentral>)
Description
Returns a Chi-Square distribution with given df (degrees of freedom). The noncentrality parameter must be greater than or equal to zero, which is the default value.
Random Exp()
Description
Returns a random number distributed exponentially from 0 to infinity. Equivalent to the negative log of Random Uniform.
Random F(dfn, dfd, <noncentral>)
Description
Returns a random number from an F distribution with a given dfn (degrees of freedom numerator) and dfd (degrees of freedom denominator). The noncentrality parameter must be greater than or equal to zero, which is the default value.
Random Frechet(<mu>, <sigma>)
Description
Returns a random number from a Fréchet distribution with the location mu and scale sigma. The default values are mu = 0 and sigma = 1.
Random Gamma(lambda, <scale>)
Description
Gives a gamma distribution for given lambda and optional scale. The default value for scale is 1.
Random Gamma Poisson(lambda, <sigma>)
Description
Returns a random number from a gamma Poisson distribution with parameters lambda and sigma. The default value for sigma is 1.
Random GenGamma(<mu=0>, <sigma=1>, <lambda=0>)
Description
Returns a random number from an extended generalized gamma distribution with parameters mu, sigma, and lambda.
Random Geometric(p)
Description
Returns random numbers from the geometric distribution with probability p that a specific event occurs at any one trial.
Random GLog(mu, sigma, lambda)
Description
Returns a random number from a generalized logarithmic distribution.
Random Index(n, k)
Description
Returns a k by 1 matrix of random integers between 1 and n with no duplicates.
Random Integer(k, n)
Description
Returns a random integer from 1 to n or from k to n.
Random Johnson Sb(gamma, delta, theta, sigma)
Description
Returns a random number from the Johnson Sb distribution.
Random Johnson Sl(gamma, delta, theta, <sigma>)
Description
Returns a random number from the Johnson Sl distribution. The default value for sigma is 1.
Random Johnson Su(gamma, delta, theta, sigma)
Description
Returns a random number from the Johnson Su distribution.
Random LEV(<mu>, <sigma>)
Description
Returns a random number from an LEV distribution with the location mu and scale sigma. The default values are mu = 0 and sigma = 1.
Random LogGenGamma(<mu=0>, <sigma=1>, <lambda=0>)
Description
Returns a random number from a log generalized gamma distribution with parameters mu, sigma, and lambda.
Random Logistic(<mu>, <sigma>)
Description
Returns a random number from a logistic distribution with the location mu and scale sigma. The default values are mu = 0 and sigma = 1.
Random Loglogistic(<mu>, <sigma>)
Description
Returns a random number from a loglogistic distribution with the location mu and scale sigma. The default values are mu = 0 and sigma = 1.
Random Lognormal(<mu>, <sigma>)
Description
Returns a Lognormal-distributed random number with location parameter mu and scale sigma. The default values are mu = 0 and sigma = 1.
Random Negative Binomial(r, p)
Description
Generates a negative binomial distribution for r successes with probability of success p.
Random Normal(<mu>, <sigma>)
Description
Generates random numbers that approximate a normal distribution with mean mu and standard deviation sigma. The default values are mu = 0 and sigma = 1.
The normal distribution is bell shaped and symmetrical.
Random Normal Mixture(mean, std_dev, probabilities)
Description
Returns a random number from a normal mixture distribution with the specified arguments.
Arguments
mean
A vector that contains group means.
std_dev
A vector that contains the group standard deviations.
probabilities
A vector that contains the group probabilities.
Random Poisson(lambda)
Description
Generates a Poisson variate for given lambda.
Random Reset(seed)
Description
Restarts the random number sequences with seed.
Random SEV(<mu>, <sigma>)
Description
Returns a random number from an SEV distribution with the specified location mu and scale sigma. The default values are mu = 0 and sigma = 1.
Random Seed State(<seed state)
Description
Retrieves or restores the random seed state to or from a blob object.
Random Shuffle(matrix)
Description
Returns the matrix with the elements shuffled into a random order.
Random t(df, <noncentral>)
Description
Returns a random number from a t distribution with the specified df (degrees of freedom). The noncentrality argument may be negative or positive. The default value of noncentral is 0.
Random Triangular(min, mode, max)
Random Triangular(mode, max)
Random Triangular(mode)
Description
Generates a random number from a triangular distribution between 0 and 1 with the mode that you specify. The triangular distribution is typically used for populations that have a small number of data.
Arguments
min
Specifies the lower limit of the triangular distribution. The default value is 0.
mode
Specifies the mode of the triangular distribution.
max
Species the upper limit of the triangular distribution. The default value is 1.
Notes
If you specify only the mode, the minimum value is 0, and the maximum value is 1. If you specify the mode and maximum value, the minimum value is 0 by default.
Random Uniform(<x>)
Random Uniform(<min>, <max>)
Description
Generates a random number from a uniform distribution between 0 and 1. Random Uniform(x) generates a number between 0 and x. Random Uniform (min, max) generates a number between min and max. The result is an approximately even distribution.
Random Weibull(beta, <alpha>)
Description
Returns a random number from a Weibull distribution. The default value for alpha is 1.
Resample Freq(<rate, <column>>)
Description
Generates a frequency count for sampling with replacement. If no arguments are specified, the function generates a 100% resample.
Arguments
rate
Optional. Specifies the rate of resampling. The default value is 1.
column
Optional. If you specify column, you must also specify rate. The sample size is calculated by the rate multiplied by the sum of the specified column.
Note
A typical use of this function generates a column with many 1s, some 0s, some 2s, and so forth, corresponding to which rows were randomly assigned any of n randomly selected rows.
A typical use of this with an existing frequency column produces a new frequency column whose values are similar to the old frequency column (have that expected value); however, the values vary somewhat due to random selection at the rates corresponding to the old frequency column.
Example
JMP chooses the frequencies for the random sampling in the pre-evaluation phase, which happens before the seed is set. When the script is initially run, the seed hasn’t been set. If the same line of code is run more than once, then after the first run, the resample frequencies are consistent, because the seed is set in the final stage of each run of the code.
To ensure that the numbers in the frequency column match each time you run the script, use As Constant(). As Constant() evaluates an expression to create a constant value that does not change after it has been computed.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dc = dt << New Column( "column",
Formula(
As Constant(
Random Reset( 123 );
0;
) + Resample Freq()
)
);
dc << Eval Formula;
Row Functions
As Table(matrix, <matrix 2, ...>, < <<invisible >, < <<Column Names(list) >)
Description
Creates a new data tables from the matrix.
Returns
The new data table.
Argument
matrix
Any matrix.
<<invisible
Creates an invisible data table that hides the table from view. The data table appears only in the JMP Home Window and the Window menu.
<<Column Names(list)
The list specified column names for the data. The argument is a list of quoted column names.
Col Stored Value(<dt>, col, <row>)
Description
Returns the data values stored in the column and disregards values assigned through column properties (such as Missing Value Codes).
Arguments
dt
Optional reference to a data table. If this value is not supplied, the current data table is used.
col
Name of the column.
row
Optional. Row name or number. If this value is not specified, the current row is used.
Example
Suppose that the Missing Value Codes column property is assigned to the x1 column to treat “999” as a missing value. Another column includes a formula that calculates the mean. To use the value “999” instead of a missing value to calculate the mean, use Col Stored Value() in the formula:
Mean( Col Stored Value( :x1 ), :x2, :x3 )
Column(<dt>, "name", "formatted")
Column(<dt>, n)
Description
Gets a reference to the data table column.
Arguments
dt
Optional reference to a data table. If this is not supplied, the current data table is used.
name
Quoted string that is the name of the column.
formatted
Quoted string that returns the formatted string of the cell value.
n
Column number.
Column Name(n)
Description
Determines the name of the column specified by number.
Returns
The name of the nth column as an expression (not a string).
Argument
n
The number of a column.
Count(from, to, step, times)
Description
Used for column formulas. Creates row by row the values beginning with the from value and ending with the to value. The number of steps specifies the number of values in the list between and including the from and to values. Each value determined by the first three arguments of the count function occurs consecutively the number of times that you specify. When the to value is reached, count starts over at the from value. If the from and to arguments are data table column names, count takes the values from the first row only. Values in subsequent rows are ignored.
Returns
The last value.
Arguments
from
Number, column reference, or expression. Count starts counting with this value.
to
Number, column reference, or expression. Count stops counting with this value.
step
Number or expression. Specifies the number of steps to use to count between from and to, inclusive.
times
Number or expression. Specifies the number of times each value is repeated before the next step.
Examples
For Each Row(:colname[row()]=count(0, 6, 3, 1))
//The rows in the column named colname are filled with the series 0, 3, 6, 0, ... until all rows are filled.
 
For Each Row(:colname[row()]=count(0, 6, 3, 2))
//The rows in the column named colname are filled with the series 0, 0, 3, 3, 6, 6, 0, ... until all rows are filled.
Note
Count() is dependent on Row(), and is therefore mainly useful in column formulas.
Current Data Table(<dt>)
Description
Without an argument, gets the current (topmost) data table. With an argument, sets the current data table.
Returns
Reference to the current data table.
Argument
dt
Optional name of or reference to a data table.
Data Table(n)
Data Table("name")
Description
Gets reference to the nth open data table or the table with the given name in a global variable.
Returns
Reference to the specified data table.
Argument
n
Number of a data table.
name
Quoted string, name of a data table.
Dif(col, n)
Description
Calculates the difference of the value of the column col in the current row and the value n rows previous to the current row.
Returns
The difference.
Arguments
col
A column name (for example, :age).
n
A number.
Lag(col, n)
Description
Returns for each row the value of the column n rows previous.
N Row(dt); NRow(matrix)
N Rows(dt); NRows(matrix)
Description
Returns the number of rows in the data table given by dt or in the matrix.
N Table()
Description
Returns the number of open data tables.
New Column("name", attributes)
Description
Adds a new column named "name" after the last column in dt.
Note
Can also be used as a message: dt<<New Column("name", attributes).
New Table("name", <visibility("invisible" | "private" | "visible")>, <actions>)
Description
Creates a new data table with the specified name.
Arguments
name
A quoted string that contains the name of the new table.
visibility
Optional quoted keyword. invisible hides the data table from view; it appears only in the JMP Home Window and the Window menu. private avoids opening the data table. visible shows the data table. "visible" is the default value. Using private data tables saves memory for smaller tables. However, for large tables (for example, 100 columns and 1,000,000 rows), using a private data table is not helpful because the data requires a lot of memory.
actions
Optional argument that can define the new table.
Row()
Row() = y
Description
Returns or sets the current row number. No argument is expected.
Sequence(from, to, <stepSize>, <repeatTimes>)
Description
Produces an arithmetic sequence of numbers across the rows in a data table. The stepSize and repeatTimes arguments are optional, and the default value for both is 1.
Subscript(a, b, c)
list[i]
matrix[b, c]
Description
Subscripts for lists extract the ith item from the list, or the bth row and the cth column from a matrix.
Suppress Formula Eval(Boolean)
Description
Turns off automatic calculation of formulas for all data tables.
Row State Functions
As Row State(i)
Description
Converts i into a row state value.
Returns
A row state from the i given.
Argument
i
an integer
Color Of(rowstate)
Description
Returns or sets the color index.
Returns
The color index of rowstate.
Argument
rowstate
a row state argument
Example
Set the color of the fifth row to red.
colorof(rowstate(5))=3
Color State(i)
Description
Returns a row state with the color index of i.
Returns
A row state.
Argument
i
index for a JMP color
Combine States(rowstate, rowstate, ...)
Description
Generates a row state combination from two or more row state arguments.
Returns
A single numeric representation of the combined row states.
Arguments
rowstate
Two or more row states.
Excluded(rowstate)
Description
Returns or sets an excluded index.
Returns
The excluded attribute, 0 or 1.
Argument
rowstate
One or more row states.
Excluded State(num)
Description
Returns a row state for exclusion from the num given.
Hidden(rowstate)
Description
Returns or sets the hidden index.
Hidden State(num)
Description
Returns a row state for hiding from the num given.
Hue State(num)
Description
Returns a hue state from the num given.
Labeled(rowstate)
Description
Returns or sets the labeled index.
Labeled State(num)
Description
Returns a labeled state from the num given.
Marker Of(rowstate)
Description
Returns or sets the marker index of a row state.
Marker State(num)
Description
Returns a marker state from the num given.
Row State(<dt,> <n>)
Description
Returns the row state changed from the initial condition of the active row or the nth row.
Arguments
dt
Optional positional argument: a reference to a data table. If this argument is not in the form of an assignment, then it is considered a data table expression.
n
The row number.
Example
The following example creates the data table references and then returns the row state of row 1 in Big Class.jmp:
dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = Open( "$SAMPLE_DATA/San Francisco Crime.jmp" );
Row State( dt1, 1 );
Selected(rowstate)
Description
Returns or sets the selected index.
Selected State(num)
Description
Returns a selected state from the num given.
Shade State(num)
Description
The Shade State function assigns 5 shade levels to a color or hue.
SAS Integration Functions
As SAS Expr(x)
Description
Converts an expression to a version that is more suitable for SAS DATA step. The code must be wrapped in a PROC DS2 call. Use Expr(...) for literal expressions. Use NameExpr(name) for expressions stored in a variable. Otherwise, the expression returns the expression to convert.
Returns
A string.
Current Metadata Connection()
Description
Returns the active SAS metadata server connection, if any, as a scriptable object.
Current SAS Connection()
Description
Gets the active global SAS server connection, if any, as a scriptable object.
Get SAS Version Preference()
Description
Returns the SAS version selected in the SAS Integration page of the Preferences as a string.
JMP6 SAS Compatibility Mode(Boolean)
Description
Setting this to 1 (true) causes SAS operators to operate in a mode compatible with JMP 6 capabilities.
Meta Connect(<"machine", port>, <"authDomain">, <"username">, <"password">, <named arguments>)
Meta Connect(<Profile("profile name")>, <Password("password")>, <named arguments>)
Meta Connect(<Environment("environment name")>, <named arguments>)
Description
Connects to a SAS Metadata Server. If no arguments are specified, an empty connection window appears. If some arguments are specified, a window partially filled in with the argument values appears. If all arguments are specified, the connection is made and no window appears.
Returns
1 if connection is successful, 0 if not.
Arguments
machine
Optional: quoted string that contains the DNS name of the machine.
port
Required if machine is specified. Quoted string or integer that contains the port on which the metadata server listens.
authDomain
Optional: quoted string that contains the authentication domain for the credentials supplied. Not necessary unless username and password are included.
username
Optional: quoted string that contains the user name for the connection.
password
Optional: quoted string that contains the password for the connection.
Named Arguments
All named arguments are optional.
Profile("profile_name")
A quoted string that contains the name of the metadata server connection profile from which connection information should be retrieved.
Environment("environment_name")
A quoted string that contains the name of the WIP environment from which connection information should be retrieved.
Password("password")
A quoted string that contains the password for the specified profile name.
CheckPreferenceOnly(0|1)
If specified, Meta Connect returns the status of the I want to connect to a SAS Metadata Server option in the SAS Integration page of JMP Preferences. If that box is checked, Meta Connect returns 1; if not, 0.
Repository("string")
Takes a quoted string that contains the name of the repository to which to connect.
ProfileLookup(0|1)
If machine and port are specified rather than a profile name, and ProfileLookup is specified, an attempt is made to find a metadata server connection profile with a machine name and port matching those provided. If one is found, other connection information (such as authentication domain, user name, and password) is obtained from that profile.
Prompt(Always|Never|IfNeeded)
Takes one of the keywords Always (always prompt before attempting to connect), Never (never prompt, just fail), or IfNeeded (the default; prompt if connection with the given arguments fails).
SASVersion("13" <,Strict>)
Attempts to change the SAS version preference to the specified value before making the metadata server connection. If the SAS version is already locked to a different version than the one specified, the SASVersion argument will fail. By default, if the SAS version cannot be set, JMP will try the metadata server connection. However, if you include Strict as the second argument, the inability to change the SAS version will be treated as an error, and JSL processing will stop. If you do not include Strict, the SAS version argument is treated as a hint and will set the version preference if it can. JMP will still try to connect if the version cannot be set. The order you put these arguments in can make a difference. The attempt to change the SAS Version is made immediately when that argument is encountered. That can affect the validity of other arguments, particularly for MetaConnect. Valid values for SASVersion are “9.1.3”, “9.2”, “9.3”, and “9.4”. Note: Using the SASVersion argument has the same effect as changing the SAS Server Version on the SAS Integration Preferences page.
Notes
If no arguments are included and if no profile is saved, the Connect to SAS Metadata Server window appears.
Meta Create Profile("profile", <named arguments>)
Description
Creates a metadata server connection profile and adds it to the current user’s set of saved metadata server connection profiles.
Returns
1 if profile was successfully created, otherwise 0.
Arguments
profile
A quoted string that contains the name of the created profile. If a profile by the given name already exists, MetaCreateProfile fails unless Replace is specified.
Named Arguments
The following named arguments are all optional.
HostName("name")
A quoted string that contains the name of the host computer running the SAS Metadata Server that this profile will connect to.
Port(n)
The port number (n) that the SAS Metadata Server is listening for connections on.
AuthenticationDomain("domain") | AuthDomain("domain")
A quoted string that sets the authentication domain to use for the connection.
Description("desc") | Desc("desc")
A quoted string that sets a description for this profile.
Password("password")
A quoted string that contains the password to store in this profile.
Replace(0|1)
If name matches a profile that already exists, Replace must be specified for the existing profile to be replaced by the one provided. The default value is False (0).
Repository("repository")
A quoted string that contains the name of the repository in the SAS Metadata Server that this profile will connect to. This option is valid only for connections to SAS 9.1.3 Metadata Servers.
UserName("username")
A quoted string that contains the user name that this profile uses to connect to the SAS Metadata Server.
UseSingleSignOn(0|1)
If specified, this profile attempts to use Single Sign-On (currently also known as Integrated Windows Authentication) to connect to the SAS Metadata Server. This option is valid only for connecting to SAS 9.2 or higher Metadata Servers. If UseSingleSignOn is True(1), UserName and Password cannot be specified. The default value is False (0).
Meta Delete Profile("name")
Description
Deletes the named metadata server connection profile from the current user’s set of saved metadata server connection profiles
Returns
1 if profile was successfully deleted, otherwise 0.
Argument
name
A quoted string that contains the name of the profile to delete.
Meta Disconnect()
Description
Disconnect the current SAS Metadata Server connection, if any.
Returns
Void.
Meta Get Repositories()
Description
Gets a list of the repositories available on the current SAS Metadata Server connection.
Returns
A list of repository names as strings.
Meta Get Servers()
Description
Get a list of the SAS Servers that are registered in the SAS Metadata Repository to which the session is currently connected.
Returns
A list of server names as strings.
Meta Get Stored Process("path")
Description
Get a stored process object from the currently connected SAS Metadata Repository.
Returns
Stored Process scriptable object.
Arguments
path
Quoted string that is the path to the stored process in metadata, starting at the BIP Tree.
Meta Is Connected()
Description
Determines whether a current connection to a SAS Metadata Server exists.
Returns
1 if a connection exists; 0 otherwise.
Arguments
None.
Meta Set Repository("repositoryName")
Description
Set the SAS Metadata Repository to use for metadata searches.
Returns
1 if setting the repository was successful, 0 otherwise.
Arguments
repositoryName
Quoted string that contains the name of the repository to make current.
SAS Assign Lib Refs("libref", "path", <"engine">, <"engine options">)
Description
Assign a SAS libref on the active global SAS server connection.
Returns
1 if successful, 0 otherwise.
Arguments
libref
Quoted string that contains a library reference (8-character maximum) to assign.
path
Quoted string that contains the full path on the SAS server to the library being assigned.
engine
Optional, quoted string that contains the engine for the SAS server to use when accessing members of this library.
engine options
Optional, quoted string that contains the options needed for the engine being used.
SAS Connect(<"machine_name">, <"port">, <named_arguments>)
Description
Connect to a local, remote, or logical SAS server.
Returns
SAS Server scriptable object.
Arguments
machine_name
Optional: quoted string that can contain a physical machine name or the name of a metadata-defined (logical) server. In the first case, the port must be provided. In the second case, a port must not be provided. If neither name nor port are included, and JMP is running on Windows, a connection to SAS on the local machine (via COM) is attempted, and all named arguments are ignored.
port
Optional: quoted string or integer. If name is a physical machine name, this is the port on that machine to connect to. If name is a metadata-defined (logical) server, port must not be included.
Named Arguments
All the named arguments are optional.
UserName("name")
A quoted string that contains the user name for the connection.
Password("password")
A quoted string that contains the password for the connection.
ReplaceGlobalConnection(0|1)
A Boolean. The default value is True. If True, and a successful SAS server connection is made, this connection replaces the active SAS connection that becomes the target of other global SAS JSL function calls. If False, the global SAS connection is not changed, and the returned SASServer scriptable object should be used to send messages to this server connection.
ShowDialog(0|1)
A Boolean. The default value is False. If True, other arguments (except ReplaceGlobalConnection) are ignored and the SAS Server Connection window appears. This provides the JSL programmer a way to open the SAS Connect window.
Prompt(Always|Never|IfNeeded)
A keyword. Always means always prompt before attempting to connect. Never means never prompt even if the connection attempt fails (just fail and send an error message to the log), and IfNeeded (the default value) means prompt if the attempt to connect with the given arguments fails (or is not possible with the information given).
ConnectLibraries(0|1)
A Boolean. Defaults to the SAS Integration Preference setting governing whether to automatically connect metadata-defined libraries when connecting to a SAS server. If true, all metadata-defined libraries are connected at SAS server connection time, which can be time-consuming. If false, metadata-defined libraries are not connected. To connect specific libraries later, use the SAS Connect Libref global function or Connect Libref message to a SAS server object.
SASVersion("13" <,Strict>)
Attempts to change the SAS version preference to the specified value before making the metadata server connection. If the SAS version is already locked to a different version than the one specified, the SASVersion argument will fail. By default, if the SAS version cannot be set, the metadata server connection will still be tried. However, if you include Strict as the second argument, the inability to change the SAS version will be treated as an error and JSL processing will stop. If you do not include Strict, the SAS version argument is treated as a hint and will set the version preference if it can, but if it cannot it will still try to connect. The order you put these arguments in can make a difference. The attempt to
change the SAS Version is made immediately when that argument is encountered.
That can affect the validity of other arguments, particularly for MetaConnect. Valid values for SASVersion are “9.1.3”, “9.2”, “9.3”, and “9.4”. Note: Using the SASVersion argument has the same effect as changing the SAS Server Version on the SAS Integration Preferences page.
SAS Deassign Lib Refs("libref")
Description
De-assign a SAS libref on the active global SAS server connection.
Returns
1 if successful; 0 otherwise.
Arguments
libref
Quoted string that contains the library reference to de-assign.
SAS Disconnect()
Description
Disconnect the active global SAS connection, if any.
Returns
1 if a SAS connection exists and was successfully disconnected, 0 otherwise.
Arguments
None.
SAS Export Data(dt, "library", "dataset", <named_arguments>)
Description
Exports a JMP data table to a SAS data set in a library on the active global SAS server connection.
Returns
1 if the data table was exported successfully; 0 otherwise.
Arguments
dt
data table or a reference to a data table.
"library"
the library to which to export the data table.
"dataset"
the name of the new SAS data set.
Named Arguments
All the named arguments are optional.
Columns(list)|Columns(col1, col2, ...)
A list of columns or a comma-separated list of columns.
Password("password")
A string that contains the password to serve as the READ, WRITE, and ALTER password for the exported SAS data set. If the exported data set is replacing an existing data set with an ALTER password, this password is used as the ALTER password for overwriting the data set. If Password is specified, values for ReadPassword, WritePassword, and AlterPassword are ignored.
ReadPassword("password")
A string that contains the password to serve as the READ password for the exported SAS data set.
WritePassword("password")
A string that contains the password to serve as the WRITE password for the exported SAS data set.
AlterPassword("password")
A string that contains the password to serve as the ALTER password for the exported SAS data set. If the exported data set is replacing an existing data set with an ALTER password, this password is used as the ALTER password for overwriting the data set.
PreserveSASColumnNames(0|1)
A Boolean. If true and the JMP data table originally came from SAS, the original SAS column names are used in the exported SAS data set. The default value is False.
PreserveSASFormats(0|1)
A Boolean. If true and the JMP data table originally came from SAS, the original SAS formats and informats are applied to the columns in the exported SAS data set. The default value is True.
ReplaceExisting(0|1)
A Boolean. If true, an existing SAS data set with the specified name in the specified library is replaced by the exported SAS data set. If false, a data set with the specified name already exists in the specified library; the export is stopped. The default value is false.
SaveJMPMetadata(0|1)
Includes SAS 9.4 Extended Attributed to store JMP metadata (such as table script and column properties). Default is 0 (disabled).
HonorExcludedRows(0|1)
A Boolean. If true, any rows in the JMP data table that are marked as excluded are not exported. The default value is false.
Note
Information about the export is sent to the log.
SAS Get Data Sets("libref")
Description
Returns a list of the data sets defined in a SAS library.
Returns
List of strings.
Arguments
libref
Quoted string that contains the SAS libref or friendly library name associated with the library for which the list of defined SAS data sets is returned.
SAS Get File("source", "dest", "encoding")
Description
Get a file from the active global SAS server connection. JMP creates a FILENAME statement (with an encoding, if specified) and uses it to read the file on the SAS server.
Returns
1 if successful, 0 otherwise.
Arguments
source
Quoted string that contains the full path of file on the server to be downloaded to the client machine.
dest
Quoted string that contains the full path on the client machine for where to put the copy of the file downloaded from the server.
encoding
Quoted string that contains the encoding used in the file (for example, "utf-8"). The server must support the specified encoding.
SAS Get File Names("fileref")
Description
Get a list of filenames found in the given fileref on the active global SAS server connection.
Returns
List of strings.
Arguments
fileref
Quoted string that contains the name of the fileref from which to retrieve filenames.
SAS Get File Names In Path("path")
Description
Get a list of filenames found in the given path on the active global SAS server connection.
Returns
List of strings.
Arguments
path
Quoted string that contains the directory path on the server from which to retrieve filenames.
SAS Get File Refs()
Description
Get a list of the currently defined SAS filerefs on the active global SAS server connection.
Returns
List of two lists. The first list is a list of quoted strings of fileref names. The second is a corresponding list of quoted strings of physical names.
SAS Get Lib Refs(<named arguments>)
Description
Get a list of the currently defined SAS librefs on the current global SAS server connection.
Returns
List of strings.
Named Arguments
Friendly Names(0|1)
Optional, Boolean. If True, then for any libraries that have friendly names (metadata-defined libraries), the friendly name is returned rather than the 8-character libref.
SAS Get Log()
Description
Retrieve the SAS Log from the active global SAS server connection.
Returns
A string.
SAS Get Output()
Description
Retrieve the listing output from the last submission of SAS code to the current global SAS server connection.
Returns
A string.
SAS Get Results()
Description
Retrieve the results of the previous SAS Submit as a scriptable object, which allows significant flexibility in what to do with the results.
Returns
A SAS Results Scriptable object.
SAS Get Var Names(string, <"dataset">, <password("password")>)
Description
Retrieves the variable names contained in the specified data set on the current global SAS server connection.
Returns
List of strings.
Arguments
string
A quoted string that contains one of the following:
The name of the SAS Library containing the SAS data set to be imported. In that case, the dataset name argument is required.
The full member name of the SAS data set to be imported, in the form “libname.membername”.
The SAS Folders tree path to a logical SAS data table to be imported. This option requires a connection to a SAS 9.2 or higher Metadata Server.
dataset
Optional: quoted string that contains the name of the data set from which to retrieve variable names.
password("password")
Optional, quoted string that contains the read password for the data set. If this is not provided and the data set has a read password, the user is prompted to enter it.
SAS Import Data(string, <"dataset">, <named arguments>)
Description
Import a SAS data set from the active global SAS server connection into a JMP table.
Returns
JMP Data Table object.
Arguments
string
A quoted string that contains one of the following:
The name of the SAS Library containing the SAS data set to be imported. In that case, the "dataset" name argument is required.
The full member name of the SAS data set to be imported, in the form “libname.membername”.
The SAS Folders tree path to a logical SAS data table to be imported. This option requires a connection to a SAS 9.2 or higher Metadata Server.
dataset
Optional: quoted string that contains the name of the data set.
Named Arguments
All named arguments are optional.
Columns("list")|Columns(col1, col2, ...)
A quoted string list or multiple strings that contain the names of columns to include in the import.
ConvertCustomFormats(0|1)
The default value is True (1). If True and custom formats are found in the SAS data set being imported, an attempt is made to convert the SAS custom formats to JMP value labels for those columns.
Invisible(0|1)
The default value is False (0). If true, the JMP data table is hidden from view. The data table appears only in the JMP Home Window and the Window menu. Hidden data tables remain in memory until they are explicitly closed, reducing the amount of memory that is available to JMP. To explicitly close the hidden data table, call Close(dt), where dt is the data table reference returned by SASImportData.
Where("filter")
A quoted string that contains the filter to use when importing data, as in Where("salary<50000").
Password("password")
A quoted string that contains the read password for the data set. If this is not provided and the data set has a read password, the user is prompted to enter it.
UseLabelsForVarNames(0|1)
If True, the labels from the SAS data set become the column names in the resulting JMP table. If False, the variable names from the SAS data set become the column names in the JMP table. The default value is False.
RestoreJMPMetadata(0|1)
Includes SAS 9.4 Extended Attributed to store JMP metadata. Default is 0 (disabled).
Sample(named arguments)
optional, named. Allows a random sample of the SAS data set to be imported into JMP. If both Where and Sample are specified, the WHERE clause is used to filter the SAS data set first, and then a random sample of the resulting rows is taken based on the arguments supplied to Sample. Note that Sample uses PROC SURVEYSELECT on the SAS server, which is available only if the SAS/STAT package is licensed and installed on that server. The documentation for PROC SURVEYSELECT might be helpful in understanding how sampling is performed. By default (if no arguments are supplied), a 5% simple random sample is taken. Available arguments (all optional) to Sample are as follows:
Simple | Unrestricted: If Simple is specified, sampling is performed without replacement. If Unrestricted is specified, sampling is performed with replacement. These two options are mutually exclusive and only one can be specified.
SampleSize(int) | N(int): Total number of rows for the sample, or number of rows per strata level for stratified sampling
SampleRate(number) | Rate(number) | Percent(number): Specifies the sampling rate. For stratified sampling, the rate is applied to each strata level. Note that the supplied value is assumed to be a percentage, so SampleRate(3.5) means a 3.5% sampling rate.
Strata({col1, col2, ...}) | Strata(col1, col2, ...): Perform stratified random sampling using the column names supplied as Strata variables.
NMin(int): Minimum number of rows (either overall or per strata level for stratified sampling) to return. Only applies to rate-based sampling.
NMax(int): Maximum number of rows (either overall or per strata level for stratified sampling) to return. Only applies to rate-based sampling.
Seed(int): Number to use as the seed for sampling. Useful for replicating the same sample. By default, the seed is a random number based on time of day. See PROC SURVEYSELECT documentation for more information.
OutputHits(0|1): Boolean; the default value is false. When doing Unrestricted sampling, if the same row of the input data set is selected more than once, by default that row still appears only once in the resulting JMP data table, with the NumberHits column indicating the number of times that the row was selected. Setting OutputHits to true causes an input row that is selected multiple times to appear multiple times in the resulting JMP data table.
SelectAll(0|1): Boolean, the default value is true. If SelectAll is true, PROC SURVEYSELECT selects all stratum rows whenever the stratum sample size exceeds the total number of rows in the stratum. If SelectAll is false and PROC SURVEYSELECT finds a case where the stratum sample size exceeds the total number of rows in a given stratum, an error results and sampling fails. SelectAll only applies to Simple random sampling.
SQLTableVariable(0|1)
If True, an SQL table variable is created in the resulting JMP table that shows the SQL that was submitted to SAS to obtain the data. If False, the SQL table variable is not created. The default value is True. If an SQL table variable is created and the data set required a read password, the password is masked.
SAS Import Query("sqlquery", <named arguments>)
Description
Execute the requested SQL query on the current global SAS server connection, importing the results into a JMP data table.
Returns
JMP Data Table object.
Arguments
sqlquery
Quoted string that contains the SQL query to perform and from which to import the result.
Named Arguments
All named arguments are optional.
ConvertCustomFormats(0|1)
The default value is true. If true and custom formats are found in the SAS data set being imported, an attempt is made to convert the SAS custom formats to JMP value labels for those columns.
Invisible(0|1)
The default value is false. If true, the JMP data table is hidden from view. The data table appears only in the JMP Home Window and the Window menu. Hidden data tables remain in memory until they are explicitly closed, reducing the amount of memory that is available to JMP. To explicitly close the hidden data table, call Close(dt), where dt is the data table reference returned by SAS Import Query.
UseLabelsForVarNames(0|1)
The default value is true. If True, the labels from the SAS data set become the column names in the resulting JMP table. If False, the variable names from the SAS data set become the column names in the JMP table.
RestoreJMPMetadata(0|1)
Includes SAS 9.4 Extended Attributes to store JMP metadata. Default is 0 (disabled).
SQLTableVariable(0|1)
The default value is true. If True, an SQL table variable is created in the resulting JMP table that shows the SQL that was submitted to SAS to obtain the data. If False, the SQL table variable is not created. If an SQL table variable is created and the data set required a read password, the password is masked.
SAS Is Connected()
Description
Discovers whether there is an active global SAS server connection.
Returns
1 if an active global SAS connection exists, 0 otherwise.
SAS Is Local Server Available()
Description
Returns True if a local SAS Server is available; otherwise, returns False.
SAS Load Text File("path")
Description
Download the file specified in path from the active global SAS server connection and retrieve its contents as a string.
Returns
String.
Arguments
"path"
Quoted string that contains the full path on the server of the file to download and retrieve the contents as a string.
SAS Name("name")
SAS Name({list of names})
Description
Converts JMP variable names to SAS variable names by changing special characters and blanks to underscores and various other transformations to produce a valid SAS name.
Returns
A string that contains one or more valid SAS names, separated by spaces.
Argument
"name"
A quoted string that represents a JMP variable name; or a list of quoted JMP variable names.
SAS Open For Var Names("path")
Description
Opens a SAS data set only to obtain the names of its variables, returning those names as a list of strings.
Returns
A list of variable names in the file.
Argument
path
A quoted string that is a pathname of a SAS data set.
SAS Send File("source", "dest", "encoding")
Description
Send a file from the client machine to the active global SAS server connection. JMP creates a FILENAME statement (with an encoding, if specified) and uses it to save the file on the SAS server.
Returns
1 if successful, 0 otherwise.
Arguments
source
Quoted string that contains the full path of the file on the client machine to be uploaded to the server.
dest
Quoted string that contains the full path on the server that receives the file uploaded from the client machine.
encoding
Quoted string that contains the encoding used in the file (for example, “utf-8”). The server must support the specified encoding.
SAS Submit("sasCode", <named arguments>)
Description
Submit some SAS code to the active global SAS server connection.
Returns
1 if successful, 0 otherwise.
Arguments
sasCode
Quoted string that contains the SAS code to submit.
Named Arguments
All named arguments are optional.
Async(0|1)
A Boolean. If True (1), the submit occurs asynchronously (in the background). Use the Get Submit Status() message on the SAS Server Scriptable Object to determine the status of the submit. The default value is False (0).
ConvertCustomFormats(0|1)
A Boolean. When SAS data sets generated by submitted SAS code are imported into JMP after the submit completes (see Open Output Datasets), the value of ConvertCustomFormats determines whether an attempt is made to convert any custom formats found on columns in the SAS data to JMP value labels. The default value is True (1).
DeclareMacros(var1, var2, ...)
JSL variable names. Provides a simple way to pass the values of JSL variables to SAS as macro variables. Each JSL variable specified should evaluate to a string or numeric value. Fully qualified JSL variables names, only the variable name is sent to SAS. For example, namespace:variable_name becomes variable_name in SAS.
GetSASLog(<Boolean|OnError>, <JMPLog|Window>)
A Boolean. If no arguments are supplied, the SAS Log is retrieved and displayed in the location indicated in SAS Integration Preferences. The first argument to GetSASLog can be either a Boolean value or the keyword OnError. If a Boolean value is supplied, true means display the SAS Log, and false means not to display it. OnError instructs JMP to only show the SAS Log if an error occurred in the submit. The second argument to GetSASLog tells JMP where to display the SAS Log. If JMPLog is specified, the SAS Log is appended to the JMP Log. If Window is specified, the SAS Log is opened in a separate window.
GraphicsDevice(string) or GDevice(string)
A string that specifies a value for the GDEVICE SAS option to be used for graphics generated by the submitted SAS code. The value must be a valid SAS graphics device. The default value is determined in Preferences.
Interactive(0|1)
JMP includes the QUIT statement in the generated wrapper code. Interactive PROCs work even if JMP is generating the ODS wrapper. On every SUBMIT, specify the argument that is part of an interactive sequence. Otherwise, QUIT will be generated in both the prologue-generated and epilogue-generated code.
NoOutputWindow
A Boolean. If True, the SAS Output window containing the listing output from the submission does not appear. The default value is False.
ODS(0|1)
If true, additional SAS code is submitted causing ODS results to be generated for the submitted SAS code. The default value is determined in Preferences.
ODSFormat(string)
A quoted string that determines the format of generated ODS results. Valid values are “HTML”, “RTF”, and “PDF”. The default value is determined in Preferences.
ODSGraphics(0|1)
If true, ODS statistical graphics are generated for the submitted SAS code. Setting ODSGraphics to true causes ODS to also be set to true. The default value is determined in Preferences.
ODSStyle(string)
A quoted string that specifies the ODS Style to use when generating ODS results. String must be a valid SAS Style. The default value is determined in Preferences.
ODSStyleSheet(path)
A quoted string that specifies a local CSS style sheet to use when formatting generated ODS results. Path must be a path to a CSS file valid for the client machine (the machine running JMP). The default value is determined in Preferences.
OnSubmitComplete(script)
A quoted string that specifies a JSL script that should be run when the submit completes. This is especially useful for asynchronous submits. If script is the name of a defined JSL function, that function is executed, with the SAS Server scriptable object passed as the first argument.
OpenODSResults(0|1)
If true, ODS results that are generated by the submitted SAS code (due to ODS being true) are automatically opened after the submit completes. The default value is True (1).
OpenOutputDatasets(<All|None|dataset1, dataset2, ...>)
JMP detects when submitted SAS code creates new SAS data sets. OpenOutputDatasets (which can be abbreviated OutData) determines what, if anything, is done with those data sets with the SAS Submit completes. If All is specified, all data sets generated by the SAS code are imported into JMP when the SAS Submit completes. If None is specified, none of the generated data sets are imported. If there are specific data sets known to be generated by the submitted SAS code that you want to be imported into JMP when the SAS submit completes, you can alternative provide their names, and only the requested data sets are imported. The default value is determined in Preferences.
Title(string)
A quoted string that specifies the window title to use for the window that displays ODS output from the submit.
SAS Submit File("filename", <named arguments>)
Description
Submit a SAS code file to the active global SAS server connection.
Returns
1 if successful; 0 otherwise.
Arguments
filename
Quoted string that contains the name of file containing SAS code to submit.
Named Arguments
Same as for SAS Submit.
SQL Functions
Note: Database table names that contain the characters $# -+/%()&|;? are not supported.
As SQL Expr(x)
Description
Converts an expression to code that you can use in an SQL Select statement. Use Expr(...) for literal expressions. Use NameExpr(name) for expressions stored in a variable. Otherwise, the expression returns the expression to convert.
Returns
A string.
New SQL Query(Connection ("ODBC:connection_string")|("SAS:connection_string"), Select(Column("column", "t1")), From(Table("table", <Schema("schema")>, <Alias("t1")>), 13), <Options(JMP 12 Compatible(1)|Run on Open(1))>
New SQL Query(Connection("ODBC:connection_string;")|("SAS:connection_string;"), Custom("SELECT col1, col2, col3 FROM table;"), 13), <Options(JMP 12 Compatible(1)|Run on Open(1))>
Description
Creates an SQL Query object for the specified connection, columns, data table, or for the custom SQL query.
Returns
A data table that contains the queried data. The data table includes the SQL query string and table scripts for modifying and updating the query.
Arguments
Connection
The string for an ODBC or SAS connection.
Select
The column that you want to select and its alias.
From
The table that is queried and the optional schema and column alias.
Custom
An SQL statement that selects columns from the specified table.
Version
The minimum JMP version required to open the query. If this condition is not met, a message regarding compatibility is written to the log, and the query does not open.
Options
Boolean. JMP 12 Compatible is included in generated scripts when you select the Query Builder preference to create a JMP 12 compatible option or select the corresponding Query Builder red triangle menu option. The option enables JMP 12 users to run a JMP 13 query that might contain compatibility issues. Include Run on Open(1) to run the query when opened rather than opening the query in edit mode.
Query(<<dt1|Table(dt1, alias1)>, ..., <dtN, aliasN)>>, <private | invisible>, <scalar>, sqlStatement )
Description
Performs a SQL query on selected data tables.
Returns
The result of the query, either a data table or a single value.
Arguments
dt1, dtN
Optional. A variable that has been assigned to the data table.
Table
Optional. Passes a reference to the data table.
alias1, aliasN
Specifies the alias of the database table.
private
Optional. Avoids opening the resulting data table. Using private data tables saves memory for smaller tables. However, for large tables (for example, 100 columns and 1,000,000 rows), using a private data table is not helpful because the data requires a lot of memory.
invisible
Optional. Hides the resulting data table from view. The data table appears only in the JMP Home Window and the Window menu. Hidden data tables remain in memory until they are explicitly closed, reducing the amount of memory that is available to JMP. To explicitly close the hidden data table, call Close(dt), where dt is the data table reference.
scalar
Optional. Indicates that the query returns a single value.
sqlStatement
Required. The SQL statement, most likely a SELECT statement. The statement must be the last argument.
Example
The following example selects all data for students who are older than 14 years of age.
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
result = Query( Table( dt, "t1" ), "SELECT * FROM t1 WHERE age > 14;" );
Notes
See Appendix A, “SQL Functions Available for JMP Queries” for details about SQLite commands that Query() supports. See the Extending JMP chapter in the Scripting Guide for more examples.
Statistical Functions
ARIMA Forecast(column, length, model, estimates, from, to)
Description
Determines the forecasted values for the specified rows of the specified column using the specified model and estimates.
Returns
A vector of forecasted values for column within the range defined by from and to.
Arguments
column
A data table column.
length
Number of rows within the column to use.
model
Messages for Time Series model options.
estimates
A list of named values that matches the messages sent to ARIMA Forecast(). If you perform an ARIMA Forecast and save the script, the estimates are part of the script.
from, to
Define the range of values. Typically, from is between 1 and to, inclusive. If from is less than or equal to 0, and if from is less than or equal to to, the results include filtered predictions.
Best Partition(xindices, yindices, <<Ordered, <<Continuous Y, <<Continuous X)
Description
Experimental function to determine the optimal grouping.
Returns
A list.
Arguments
xindices, yindices
Same-dimension matrices.
Col Cumulative Sum(name, <By var, ...>)
Cumulative Sum(name)
Description
Returns the cumulative sum for the current row. Col Cumulative Sum supports By columns, which do not need to be sorted.
Arguments
name
A column name.
By var
Optional: A By variable to compute statistics across groups of rows. Use the By variable in a column formula or in a For Each Row() function.
Col Maximum(name, <By var, ...>)
Col Max(name)
Description
Calculates the maximum value across all rows of the specified column. The result is internally cached to speed up multiple evaluations.
Returns
The maximum value that appears in the column.
Arguments
name
a column name.
By var
Optional: A By variable to compute statistics across groups of rows. Use the By variable in a column formula or in a For Each Row() function.
Notes
If a data value is assigned by a column property (such as Missing Value Codes), use Col Stored Value() to base the calculation on the value stored in the column instead. See “Col Stored Value(<dt>, col, <row>)”.
Col Mean(name, <By var, ...>)
Description
Calculates the mean across all rows of the specified column. The result is internally cached to speed up multiple evaluations.
Returns
The mean of the column.
Argument
name
a column name.
By var
Optional: A By variable to compute statistics across groups of rows. Use the By variable in a column formula or in a For Each Row() function.
Notes
If a data value is assigned by a column property (such as Missing Value Codes), use Col Stored Value() to base the calculation on the value stored in the column instead. See “Col Stored Value(<dt>, col, <row>)”.
Col Minimum(name, <By var, ...>)
Col Min(name)
Description
Calculates the minimum value across all rows of the specified column. The result is internally cached to speed up multiple evaluations.
Returns
The minimum value that appears in the column.
Argument
name
a column name.
By var
Optional: A By variable to compute statistics across groups of rows. Use the By variable in a column formula or in a For Each Row() function.
Notes
If a data value is assigned by a column property (such as Missing Value Codes), use Col Stored Value() to base the calculation on the value stored in the column instead. See “Col Stored Value(<dt>, col, <row>)”.
Col Moving Average(name, options, <By var, ...>)
Moving Average(name, options)
Description
Returns the moving average over a given interval based at the current row. Col Moving Average supports By columns.
Arguments
name
A column name.
Before(1|0|n)
Positional argument. Controls the size of the range (or window) by including the specified number of items before the current item in the average (in addition to the current item). -1 means all prior items.
After(1|0|n)
Positional argument. Controls the size of the range (or window) by including the specified number of items after the current item in the average (in addition to the current item). -1 means all prior items.
Weighting(1|0|n)
Positional argument. Determines how the values are weighted. 1 indicates uniform weighting. 0 indicates incremental weighting (a ramp or triangle). Any other number is the parameter for an exponential moving average (EWMA or EMA).
Partial Window is Missing
Boolean positional argument. Controls how missing values are treated. By default, missing values are ignored.
By var
Optional: A By variable to compute statistics across groups of rows. Use the By variable in a column formula or in a For Each Row() function.
Examples
Col Moving Average( x, 1, 4 );
// equal weighting of a five-item lagging range
Col Moving Average( x, 0 );
// ramp weighting of all preceding items
Col Moving Average( x, 0, 2, 2 );
// triangle weighting of a five-item centered range
Col Moving Average( x, 0.25 );
// exponential weighting of all preceding items
Col N Missing(name, <By var, ...>)
Description
Calculates the number of missing values across all rows of the specified column. The result is internally cached to speed up multiple evaluations.
Returns
The number of missing values in the column.
Argument
name
a column name.
By var
Optional: A By variable to compute statistics across groups of rows. Use the By variable in a column formula or in a For Each Row() function.
Notes
If a data value is assigned by a column property (such as Missing Value Codes), use Col Stored Value() to base the calculation on the value stored in the column instead. See “Col Stored Value(<dt>, col, <row>)”.
Col Number(name, <By var, ...>)
Description
Calculates the number of nonmissing values across all rows of the specified column. The result is internally cached to speed up multiple evaluations.
Returns
The number of nonmissing values in the column.
Argument
name
a column name.
By var
Optional: A By variable to compute statistics across groups of rows. Use the By variable in a column formula or in a For Each Row() function.
Notes
If a data value is assigned by a column property (such as Missing Value Codes), use Col Stored Value() to base the calculation on the value stored in the column instead. See “Col Stored Value(<dt>, col, <row>)”.
Col Quantile(name, p, <ByVar>)
Description
Calculates the specified quantile p across all rows of the specified column. The result is internally cached to speed up multiple evaluations.
Returns
The value of the quantile.
Argument
name
a column name.
p
a specified quantile p between 0 and 1.
ByVar
the By group.
Example
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
Col Quantile( :height, .5 );
63
63 is the 50th percentile, or the median, of all rows in the height column.
Notes
If a data value is assigned by a column property (such as Missing Value Codes), use Col Stored Value() to base the calculation on the value stored in the column instead. See “Col Stored Value(<dt>, col, <row>)”.
Col Rank(column, <ByVar, ...>, <<tie("average"|"arbitrary"|"row"|"minimum")
Description
Ranks each row’s value, from 1 for the lowest value to the number of columns for the highest value. Ties are broken arbitrarily.
Argument
ByCar
(Optional) A By variable to compute statistics across groups of rows.
column
The column to be ranked.
<<tie
Determines how the tie is broken. A tie occurs when the values being ranked are the same. For the data [33 55 77 55], 33 has rank 1 and 77 has rank 4, and the question is how to assign ranking for the 55s. average reports the average of the possible rankings, 2.5, for both 55s. arbitrary matches JMP 12 behavior by assigning the possible rankings in an unspecified order, which could be 2 and 3 or 3 and 2. row assigns the ranks in the order that they originally appear. (The first 55 would be 2 and the second 55 would be 3.)
minimum gives both values the lowest possible rank, 2.
Notes
If a data value is assigned by a column property (such as Missing Value Codes), use Col Stored Value() to base the calculation on the value stored in the column instead. See “Col Stored Value(<dt>, col, <row>)”.
Col Standardize(name)
Description
Calculates the column mean divided by the standard deviation across all rows of the specified column.
Returns
The standardized mean.
Argument
name
a column name.
Notes
Standardizing centers the variable by its sample standard deviation. Thus, the following commands are equivalent:
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "stdht", Formula( Col Standardize( height ) ) );
dt << New Column( "stdht2",
Formula( (height - Col Mean( height )) / Col Std Dev( height ) )
);
Notes
If a data value is assigned by a column property (such as Missing Value Codes), use Col Stored Value() to base the calculation on the value stored in the column instead. See “Col Stored Value(<dt>, col, <row>)”.
Col Std Dev(name,<By var, ...>)
Description
Calculates the standard deviation across rows in a column. The result is internally cached to speed up multiple evaluations.
Returns
The standard deviation.
Argument
name
a column name.
By var
Optional: A By variable to compute statistics across groups of rows. Use the By variable in a column formula or in a For Each Row() function.
Notes
If a data value is assigned by a column property (such as Missing Value Codes), use Col Stored Value() to base the calculation on the value stored in the column instead. See “Col Stored Value(<dt>, col, <row>)”.
Col Sum(name,<By var, ...>)
Description
Calculates the sum across rows in a column. Calculating all missing values (Col Sum(.,.)) returns missing. The result is internally cached to speed up multiple evaluations.
Returns
The sum.
Argument
name
a column name.
By var
Optional: A By variable to compute statistics across groups of rows. Use the By variable in a column formula or in a For Each Row() function.
Notes
If a data value is assigned by a column property (such as Missing Value Codes), use Col Stored Value() to base the calculation on the value stored in the column instead. See “Col Stored Value(<dt>, col, <row>)”.
Fit Censored(Distribution("name"), YLow(vector) | Y(Vector), <YHigh(vector)>, <Weight(vector)>, <X(matrix)>, <Z(matrix)>, <HoldParm(vector)>)
Description
Fits a distribution using censored data.
Returns
A list that contains parameter estimates, the covariance matrix, the log-likelihood, the AICc, the BIC, and a convergence message.
Arguments
Distribution("name")
The quoted name of the distribution to fit.
YLow(vector) | Y(Vector)
If you do not have censoring, then use Y and an array of your data, and do not specify YHigh. If you do have censoring, then specify YLow and YHigh as the lower and upper censoring values, respectively.
Optional Arguments
YHigh(vector)
A vector that contains the upper censoring values. Specify this only if you have censoring and also specify YLow.
Weight(vector)
A vector that contains the weight values.
X(matrix)
The regression design matrix for location.
Z(matrix)
The regression design matrix for scale.
HoldParm(vector)
An array of specified parameters. The parameters should be nonmissing where they are to be held fixed, and missing where the are to be estimated. This is primarily used to test hypotheses that certain parameters are zero or some other specific value.
Hier Clust(x)
Description
Returns the clustering history for a hierarchical clustering using Ward’s method (without standardizing data).
Argument
x
A data matrix.
IRT Ability(Q1, <Q2, Q3, ...,> parameter matrix)
Description
Solves for ability in an Item Response Theory model.
KDE(vector, <named arguments>)
Description
Returns a kernel density estimator with automatic bandwidth selection.
Argument
vector
A vector.
Named Arguments
All the named arguments are optional.
<<weights
Must be a vector of the same length as vector, and can contain any nonnegative real numbers. Weights represents frequencies, counts, or similar concepts.
<<bandwidth(n)
A nonnegative real number. Enter a value of 0 to use the bandwidth selection argument.
<<bandwidth scale(n)
A positive real number.
<<bandwidth selection(n)
n must be 0, 1, 2, or 3, corresponding to Sheather and Jones, Normal Reference, Silverman rule of thumb, or Oversmoother, respectively.
<<kernel(n)
n must be 0, 1, 2, 3, or 4, corresponding to Gaussian, Epanechnikov, Biweight, Triangular, or Rectangular, respectively.
LenthPSE(x)
Description
Returns Lenth’s pseudo-standard error of the values within a vector.
Argument
x
A vector.
Max()
Maximum(var1, var2, ...)
Max(var1, var2, ...)
Description
Returns the maximum value of the arguments or of the values within a single matrix or list argument. If multiple arguments are specified, they must be either all numeric values or all strings.
Mean(var1, var2, ...)
Description
Rowwise mean of the variables specified.
Min
Minimum(var1, var2, ...)
Min(var1, var2, ...)
Description
Returns the minimum value of the arguments or of the values within a single matrix or list argument. If multiple arguments are specified, they must be either all numeric values or all strings.
N Missing(expression)
Description
Rowwise number of missing values in variables specified.
Number(var1, var2, ...)
Description
Rowwise number of nonmissing values in variables specified.
Product(i=initialValue, limitValue, bodyExpr)
Description
Multiplies the results of bodyExpr over all i until the limitValue and returns a single product.
Quantile(p, arguments)
Description
Returns the pth quantile of the arguments. The first argument can be a scalar or a matrix of values between 0 and 1. The remaining arguments can also be specified as values within a single matrix or list argument.
Std Dev(var1, var2, ...)
Description
Rowwise standard deviation of the variables specified.
Sum(var1, var2, ...)
Description
Rowwise sum of the variables specified. Calculating all missing values (Sum(.,.))returns missing.
SSQ(x1, ...)
Description
Returns the sum of squares of all elements. Takes numbers, matrices, or lists as arguments and returns a scalar number. Skips missing values.
Summarize(<dt>, <by>, <count>, <sum>, <mean>, <min>, <max>, <stddev>, <corr>, <quantile>, <first>)
Description
Gathers summary statistics for a data table and stores them in global variables.
Returns
None.
Arguments
dt
Optional positional argument: a reference to a data table. If this argument is not in the form of an assignment, then it is considered a data table expression.
All other arguments are optional and can be included in any order. Typically, each argument is assigned to a variable so you can display or manipulate the values further.
name=By(col | list | Eval)
Using a BY variable changes the output from single values for each statistic to a list of values for each group in the BY variable.
Summarize YByX(X(<x columns>, Y (<y columns>), Group(<grouping columns>), Freq(<freq column>), Weight(<weight column>))
Description
Calculates all Fit Y by X combinations on large-scale data sets.
Returns
A data table of p-values and LogWorth values for each Y and X combination. See the Response Screening chapter in Predictive and Specialized Modeling.
Arguments
X(col)
The factor columns used in the fit model.
Y(col)
The response columns used in the fit model.
Group(gcol)
The group of columns used in the fit model.
Freq(col)
The frequency (for each row) column used in the fit model.
Weight(col)
The importance (or influence) column used in the fit model.
Note
Performs the same function as the Response Screening platform. See the Response Screening chapter in the Predictive and Specialized Modeling book for details.
Summation(init, limitvalue, body)
Description
Summation sums the results of the body statement(s) over all i to return a single value.
Tolerance Limit(1-alpha, p, n)
Description
Constructs a 1-alpha confidence interval to contain proportion p of the means with sample size n.
Transcendental Functions
Arrhenius(n)
Description
Converts the temperature n to the value of explanatory variable in Arrhenius model.
Returns
11605/(n+273.15)
Argument
n
Temperature in Celsius.
Notes
This is frequently used as a transformation.
Arrhenius Inv(n)
Description
The inverse of the Arrhenius function. Converts the value n to the temperature in Celsius.
Returns
11605/(n-273.15)
Argument
n
The value of the converted explanatory variable in Arrhenius model.
Notes
This is frequently used as a transformation.
Beta(a, b)
Description
Equation shown here
Returns
Returns the beta function.
Arguments
a, b
numbers
Digamma(n)
Description
The derivative of the log of the gamma function (LGamma).
Returns
The digamma function evaluated at n.
Argument
n
A number
Exp(a)
Description
Raises e to the power a.
Returns
ea.
Argument
a
A number
Equivalent Expression
e()^a
ExpM1(x)
Description
Returns a more accurate calculation of Exp(x)-1 when x is very small.
Factorial(n)
Description
Multiplies all numbers 1 through n, inclusive
Returns
The product.
Arguments
n
Any integer
Notes
One and only one argument must be specified.
FFT(list, <named arguments>)
Description
Conducts a Fast Fourier Transformation (FFT) on a list of matrices.
Returns
The function takes one matrix, or a list of matrices for complex numbers. The returned value is a list of two matrices with the same dimensions as the first argument.
Argument
List
A list of one or two matrices. If one is provided, it is considered to be the real part. If two are provided, the first is the real part and the second is the imaginary part. Both matrices must have the same dimensions, and both must have more than one row.
Named Arguments
All named arguments are optional.
<<inverse(Boolean)
If true (1), an inverse FFT is conducted.
<<multivariate(Boolean)
If true (1), a multivariate FFT is conducted. If false(0), a spatial FFT is conducted.
<<scale(number)
Multiplies the return values by the specified number.
Fit Transform To Normal(Distribution("name"), Y(vector), <Freq(vector))
Description
Fits a transformation to normality for a vector of data. This includes the Johnson Sl, Johnson Sb, Johnson Su, and GLog distributions.
Returns
A list that contains parameter estimates, the covariance matrix, the log-likelihood, AICc, a convergence message, and the transformed values.
Gamma(t, <limit>)
Description
The gamma function of x, or for each row if x is a column:
Equation shown here
Returns
The gamma.
Note
Gamma(t, limit) is the same integral as Gamma(t) but with the limit of integration that is defined instead of infinity.
Arguments
t
a number or a column
limit
optional limit. The default is infinity.
LGamma(t)
Description
Returns the log gamma function for t, which is the natural log of gamma.
Ln(n)
LnZ(n)
Description
Returns the natural logarithm (base e logarithm) of n.
Note
This function is intended for internal use by derivatives. The Ln(n) function is recommended instead.
Log(n, <base>)
Description
Returns the natural logarithm (base e logarithm) of n. An optional second argument lets you specify a different base. For example, Log(n,3) for the base 3 logarithm of n. The Log argument can be any numeric expression. The expression Log(e()) evaluates as 1, and Log(32,2) is 5.
Log10(n)
Description
Returns the common (base 10) logarithm of n.
Log1P(n)
Description
Same as Log(1 + x), except that it is more accurate when x is very small.
Logit(p)
Description
Returns log(p/(1-p)).
N Choose K(n, k)
Description
This function returns the number of n things taken k at a time (“n choose k”) and is computed in the standard way using factorials, as Equation shown here. For example, NChooseK(5,2) evaluates as 10.
Note
This is implemented internally in JMP using lGamma functions. The result is not always an integer.
Power(a, <b>)
a^b
Description
Raises a to the power of b.
Returns
The product of a multiplied by itself b times.
Arguments
a
Can be a variable, number, or matrix.
b
Optional. Can be a variable or a number.
Notes
For Power(), the second argument (b) is optional, and the default value is 2. Power(a) returns a2.
Root(n, <r>)
Description
Returns the rth root of n, where r defaults to 2 for square root.
SbInv(z, gamma, delta, theta, sigma)
Description
Johnson Sb inverse transformation. If argument is normal, the result is Johnson Sb.
SbTrans(x, gamma, delta, theta, sigma)
Description
Johnson Sb transformation from a doubly bound variable to a standard normal (0, 1) distribution.
Scheffe Cubic(x1, x2)
Description
Returns x1*x2*(x1-x2). This function supports notation for cubic mixture models.
SlInv(z, gamma, delta, theta, sigma)
Description
Johnson Sl inverse transformation. If argument is normal, the result is Johnson Sl.
SlTrans(x, gamma, delta, theta, sigma)
Description
Johnson Sl transformation from a doubly bound variable to a standard normal (0, 1) distribution.
Sqrt(n)
Description
Returns the square root of n.
Squash(expr)
Description
An efficient computation of the function 1/ [1 + exp(expr)].
Squish(expr)
Description
Equivalent to Squash(-expr), or Equation shown here.
SuInv(z, gamma, delta, theta, sigma)
Description
Johnson Su inverse transformation. If argument is normal, the result is Johnson Su.
SuTrans(x, gamma, delta, theta, sigma)
Description
Johnson Su transformation from a doubly bound variable to a standard normal (0, 1) distribution.
Trigamma()
Description
Returns the trigamma function evaluated at n. The trigamma function is the derivative of the digamma function.
Trigonometric Functions
JMP’s trigonometric functions expect all angle arguments in radians.
ArcCosH(x)
Description
Inverse hyperbolic cosine.
Returns
The inverse hyperbolic cosine of x.
Argument
x
Any number, numeric variable, or numeric expression.
ArcCosine(x)
ArCos(x)
Description
Inverse cosine.
Returns
The inverse cosine of x, an angle in radians.
Argument
x
Any number, numeric variable, or numeric expression.
ArcSine(x)
ArSin(x)
Description
Inverse sine.
Returns
The inverse sine of x, an angle in radians.
Argument
x
Any number, numeric variable, or numeric expression.
ArcSinH(x)
Description
Inverse hyperbolic sine.
Returns
The inverse hyperbolic sine of x.
Argument
x
Any number, numeric variable, or numeric expression.
ArcTangent(x1, <x2=1>)
ArcTan(1x <x2=1>)
ATan(x1 <x2=1>)
Description
Inverse tangent.
Returns
The inverse trigonometric tangent of x1/x2, where the result is in the range -Pi()/2, Pi()/2.
Argument
x1
Any number, numeric variable, or numeric expression.
x2=1
Specifies atan2.
ArcTanH(x)
Description
Inverse hyperbolic tangent.
Returns
The inverse hyperbolic tangent of x.
Argument
x
Any number, numeric variable, or numeric expression.
CosH(x)
Description
Hyperbolic cosine.
Returns
The hyperbolic cosine of x.
Argument
x
Any number, numeric variable, or numeric expression.
Cosine(x)
Cos(x)
Description
Cosine.
Returns
The cosine of x.
Argument
x
Any number, numeric variable, or numeric expression. The angle in radians.
Sine(expr)
Sin(expr)
Description
Returns the sine.
SinH(expr)
Description
Returns the hyperbolic sine.
Tangent(expr)
Tan(expr)
Description
Returns the tangent of an argument given in radians.
TanH(expr)
Description
Returns the hyperbolic tangent of its argument.
Utility Functions
Add(a, b, ...)
a+b+...
Description
Adds the values of the listed arguments. No arguments are changed.
Returns
The sum.
Arguments
For Add(), a comma-separated list of variables, numbers, or matrices.
For a+b, any number of variables, numbers, or matrices.
Notes
Any number of arguments is permitted. If no argument is specified, Add() returns 0.
See Also
The Data Structures chapter in the Scripting Guide.
Batch Interactive(Boolean)
Description
Sets the run-time environment for JSL to either batch mode or interactive mode.
Returns
The previous setting.
Example
Batch Interactive(1); // Set Batch mode one
<code>
Batch Interactive(0); // Revert to previous mode
Note
This function can be used in journal scripts, to ensure that messages are sent to the log rather than to interactive message windows.
Beep()
Description
Produces an alert sound.
Returns
Null.
Blob MD5(blob)
Description
Converts the blob argument into a 16-byte blob.
Note
The 16-byte blob is the MD5 checksum, or the hash, of the source blob.
Blob Peek(blob, offset, length)
Description
Creates a new blob from a subrange of bytes of the blob argument.
Returns
A blob object.
Arguments
blob
a binary large object.
offset
An integer that specifies how many bytes into the blob to begin construction. The first byte is at offset 0, the second byte at offset 1.
length
An integer that specifies how many bytes to copy into the new blob, starting at the offset.
Build Information()
Description
Returns the build date and time, whether it’s a release or debug build, and the product name in a comma-delimited string.
Caption({h, v}, "text", <Delayed(seconds)>, <Font(font)>, <Font Size(size)>, <Text Color("color")>, <Back Color("color")>, <Spoken(Boolean)
Description
Displays a caption window at the location described by {h, v} that displays text. The caption can be delayed before being displayed by seconds, or can be spoken. You can also specify the font type, size, and color and background color.
Returns
Null.
Arguments
{h, v}
a list with two values. h is the horizontal displacement from the top left corner of the monitor in pixels. v is the vertical displacement from the top left corner in pixels.
text
A quoted string or a reference to a string that is to be displayed in the caption.
Delayed(seconds)
seconds is optional delay before displaying the caption. Setting this option causes this caption and all subsequent captions to be delayed by the specified number of seconds.
Font(font)
Specify the font type.
Font Size(size)
Specify the font size.
Text Color("color")
Specify the color of text.
Back Color("color")
Specify the background color.
Spoken(Boolean)
Causes text to be spoken as well as displayed. The current setting (on or off) remains in effect until switched by another Caption statement that includes a Spoken setting.
Datafeed()
Debug Break()
When the JSL Debugger is open, this function stops a JSL script from executing at that point in the script. This function is useful for tracking in the debugger under user-specified conditions. If the JSL Debugger is not running, this function does not execute.
Decode64 Double("string")
Description
Creates a floating point number from a base 64 encoded string.
Returns
A floating point number.
Arguments
string
a base 64 encoded string.
Divide(a, b)
Divide(x)
a/b
Description
Divides a by b. If only one argument is given (divide(x)), divides 1 by x.
Returns
The quotient of a/b; or the reciprocal of x (1/x) if only one argument is provided.
Arguments
a, b, x
Can be a variable, number, or matrix.
Notes
If both arguments are matrices, it does matrix division.
See Also
The Data Structures chapter in the Scripting Guide.
Empty()
Description
Does nothing. Used in the formula editor for making empty boxes.
Returns
Missing.
Arguments
None.
Encode64 Double(n)
Description
Creates a base 64 encoded string from a floating point number.
Returns
A base 64 encoded string.
Arguments
n
a floating point number.
Faure Quasi Random Sequence(nDim, nRow)
Description
Generates a sequence of spacefilling quasi random numbers using the Faure sequence.
Get Addin("id")
Description
Retrieves a registered add-in by id.
Returns
A scriptable object for the add-in. Returns empty if no add-in with the specified ID was found.
Argument
"id"
The ID of an installed add-in.
Get Addins()
Returns
A list of all registered add-ins.
Get Addr Info("address", <port>)
Description
Converts a name to its numeric address.
Returns
A list of strings. The first element is the command (Get Addr Info). The second is the results (for example, “ok” if the command was successful). The third is a list of strings of information. Included in that information is the address that corresponds to the name that was supplied.
Arguments
address
A quoted string that specifies the name (for example, "www.sas.com").
port
The port of the address.
Get Clipboard()
Description
Returns text from the computer’s clipboard. If the content is not text, the result is null.
Get Name Info("address", <port>)
Description
Converts a numeric address to its name.
Returns
A list of strings. The first element is the command (GetNameInfo). The second is the results (for example, “ok” if the command was successful). The third is a list of strings of information. Included in that information is the port name that corresponds to the address that was supplied.
Arguments
address
A quoted string that specifies the numeric address (for example, "149.173.5.120").
port
The port of the address.
Get Platform Preferences(<platform <(option, ...)> ... >)
Get Platform Preference(<platform <(option, ...)> ... >)
Description
Returns the preferences for the specified platforms.
Returns
A list of platform preferences.
Argument
platform
Optional. Specifies the platform name. If not specified, all platform preferences are returned. You can specify one or more preferences for a platform.
option
Optional. Specifies the preference value. If not specified, all platform preference values are returned.
Notes
Table 2.3 describes the syntax for getting platform preferences.
 
Table 2.3 Get Platform Preferences() Syntax 
Syntax
Description
Get Platform Preferences( )
Returns the current option values for all platform preferences.
Get Platform Preferences( Platform )
Returns the current option values for the specified platform preferences.
Get Platform Preferences( Platform( Option ) )
Returns the current option values for the specified platform.
Get Platform Preferences( <<Changed )
Returns the current option values that have changed for all platforms.
Get Platform Preferences( Platform( <<Changed ) )
Returns the current option values that have changed for all platform preferences.
Get Platform Preferences( Platform( Option (
<<Changed ) ) )
Returns the current option values that have changed for the specified platform.
Examples
Suppose that the user modified several platform preferences through the JMP Platforms window or a script.
Platform Preferences(
Distribution( Set Bin Width( 2 ), Horizontal Layout( 1 ) ),
Model Dialog( Keep Dialog Open( 1 ) ),
Graph Builder( Legend Position( "Bottom" ) )
);
To return all of the modified platform preferences, use Get Platform Preferences( <<Changed ):
Get Platform Preferences( <<Changed );
Platform Preferences(
Distribution( Horizontal Layout( 1 ), Set Bin Width( 2, <<On ) ),
Graph Builder( Legend Position( "Bottom", <<On ) ),
Model Dialog( Keep dialog open( 1 ) )
);
Get Preferences(<preference_name>)
Get Preference(<preference_name>)
Description
Returns the settings for the specified preferences.
Returns
A list of preference settings.
Argument
preference_name
Optional. If no preference is specified, all preferences are returned. Otherwise, the settings for the specified preference are returned.
Notes
The preferences for the following areas are not accessible in JSL: Text Data Files, Windows Specific, Macintosh OS Settings, Fonts, Communications, Script Editor, and JMP Updates. For details about getting platform preferences, see “Get Platform Preferences(<platform <(option, ...)> ... >)”.
Glue(expr1, expr2, ...)
expr1; expr2
Description
Evaluates each argument in turn.
Returns
The result of the last argument evaluated.
Arguments
One or more valid JSL expressions.
Note
A semicolon placed between expressions is the more commonly used form for Glue().
Host Is(argument)
Description
Determines whether the host environment is the specified OS.
Returns
True (1) if the current host environment matches the argument, false (0) otherwise.
Argument
Argument
Windows or Mac tests for the specified operating system. Bits32 or Bits64 tests for the specified 32-bit or 64-bit machine.
Note
Only one argument can be tested at a time. Invalid arguments return false (0).
Is Alt Key()
Description
Returns 1 if the Alt key is being pressed, or 0 otherwise.
Note
On a Macintosh, Is Alt Key() tests for the Option key.
Is Command Key()
Description
Returns 1 if the Command key is being pressed, or 0 otherwise.
Is Context Key()
Description
Returns 1 if the Context key is being pressed, or 0 otherwise.
Is Control Key()
Description
Returns 1 if the Control key is being pressed, or 0 otherwise.
Note
On a Macintosh, Is Control Key() tests for the Command key.
Is Option Key()
Description
Returns 1 if the Option key is being pressed, or 0 otherwise.
Is Shift Key()
Description
Returns 1 if the Shift key is being pressed, or 0 otherwise.
JMP Product Name()
Description
Returns either "Standard", "Pro", or "Student", depending on which version of JMP is licensed.
JMP Version()
Description
Returns the version number of JMP that you are running.
Returns
release.revision<.fix>
Arguments
none
Load DLL("path" <,AutoDeclare(Boolean | Quiet | Verbose)>)
Load DLL("path" <, Quiet | Verbose>)
Description
Loads the DLL in the specified path.
Arguments
path
A pathname that specifies where to load the DLL.
AutoDeclare(Boolean | Quiet | Verbose)
Optional argument. AutoDeclare(1) and AutoDeclare(Verbose) write verbose messages to the log. AutoDeclare(Quiet) turns off log window messages. If you omit this option, verbose messages are written to the log.
Quiet | Verbose
Optional argument. When you use Declare Function(), this option turns off log window messaging (Quiet) or turns on log window messaging (Verbose).
See Also
Once a DLL is loaded, you send the DLL object messages to interact with it. See “Dynamic Link Libraries (DLLs)” in the “JSL Messages” chapter for details about these messages. The Extending JMP chapter in the Scripting Guide also includes examples.
Mail("address", "subject", "message", <"attachment filepath" | {"attachment 1 filepath", "attachment 2 filepath", ...}>)
Description
(Windows) Sends e-mail (using MAPI) to the address with the specified subject and message texts. Sends one or more attachments specified by the optional attachment argument. The attachment argument can evaluate to a string or list of strings.
(Macintosh) Creates an e-mail in the user’s Mail application. The user must click Send in the e-mail. On Mountain Lion, you must enter the e-mail address and subject in the e-mail due to operating system limitations. Click the Send message button to send the e-mail.
Examples
To send an email with multiple attachments:
Mail(
"New data and script",
"Today’s updated data table and script are attached.",
{"$DOCUMENTS/wd.jsl", "$DOCUMENTS/survey.jmp"}
);
or:
list = {"$DOCUMENTS/wd.jsl", "$DOCUMENTS/survey.jmp"};
Mail(
"New data and script",
"Today’s updated data table and script are attached.",
list
);
Notes
On Macintosh, Mail() works on Mountain Lion and later operating systems.
Main Menu(string, <string>)
Description
Execute the command found on JMP’s menu named by the quoted string.
Arguments
string
The internal path name as shown in the menu editor for items. For example, “NEW” is the internal name for the New subcommand in the File menu.
string
Optional. The name of the window to send the command to.
Examples
Main Menu() accepts either a full path or a partial path. If a partial name is used, and there are other menu items with the same name, the first menu item found is executed. JMP searches the top-level menu (File, Tables, DOE, and so on) first for the partial name and then searches inside each of those menus in order.
Main Menu( "File:New:Data Table" ); // full path
Main Menu( "Data Table" ); // partial path
Minus(a)
-a
Description
Reverses the sign of a.
Returns
-a if a is positive (a=3; -a=-3; Minus(a)=-3).
a if a is negative (a=-3; -a=3; Minus(a)=3).
0 if a is 0 (a=0; -a=0; Minus(a)=0).
Missing if a is missing.
Argument
a
Can be variable or a number. A variable must contain a number or a matrix.
Multiply(a, b, ...)
a*b*...
Description
Multiplies all values. No arguments are changed.
Returns
The product.
Arguments
Any number of variables, numbers, or matrices.
Notes
Any number of arguments is permitted. If no argument is specified, Multiply() returns 1.
See Also
The Data Structures chapter in the Scripting Guide.
Open Datafeed()
Datafeed()
Description
Creates a Datafeed object and window.
Returns
A reference to the Datafeed object.
Arguments
No arguments are required. You usually set up the basic operation of the data feed within the Open Datafeed() command, however.
Parse XML(string, On Element("tagname", Start Tag(expr), End Tag(expr)))
Description
Parses an XML expression using the On Element expressions for specified XML tags.
Platform Preferences(platform(option(value)), ...)
Platform Preference(platform(option(value)), ...)
Set Platform Preferences(platform(option(value)), ...)
Set Platform Preference(platform(option(value)), ...)
Description
Sets and resets values for platform options and turns the options on and off.
Arguments
platform
Specifies the platform of the preference.
option
Specifies the preference name.
value
Specifies the preference value.
Notes
Table 2.4 describes the syntax for setting platform preferences.
 
Table 2.4 Platform Preferences() Syntax 
Syntax
Description
Platform Preferences( <<Default )
Platform Preferences( <<Factory Default )
Platform Preferences( Default )
Resets all platform preferences to their default values.
Platform Preferences( Platform( <<Default ) )
Platform Preferences( Platform( <<Factory Default ) )
Platform Preferences( Platform( Default ) )
Resets the specified platform preferences to their default values.
Platform Preferences( Platform( option ( <<Default ) ) )
Platform Preferences( Platform( option ( <<Factory Default ) ) )
Resets the specified platform option to its default value.
Platform Preferences( Platform( option( value ) ) )
Sets the value of the specified platform option. Turned on by default.
Platform Preferences( Platform( option ) )
Resets the specified platform option back to its default value.
Platform Preferences( Platform( option( <<On ) ) )
Turns on the specified platform option.
Platform Preferences( Platform( option( <<Off ) ) )
Turns off the specified platform option.
Platform Preferences( Platform( option( value, <<On ) ) )
Sets the value of the specified platform option and turns it on.
Platform Preferences( Platform( option( value, <<Off ) ) )
Sets the value of the specified platform option and turns it off.
Example
The following expression selects (or turns on) Set Bin Width in the Distribution platform preferences and sets the value to 2:
Platform Preferences( Distribution( Set Bin Width( 2 ) ) );
The following expression changes the Set Bin Width value and turns the option off:
Platform Preferences( Distribution( Set Bin Width( 2, <<Off ) ) );
The following expression resets the default Set Bin Width value and deselects the preference:
Platform Preferences( Distribution( Set Bin Width( <<Default ) ) );
Polytope Uniform Random(samples, A, b, L, U, neq, nle, nge, <nwarm=200>, <nstride=25>)
Description
Generates random uniform points over a convex polytope.
Arguments
Samples
The number of random points to be generated.
A
The constraint coefficient matrix.
B
The right hand side values of constraints.
L, U
The lower and upper bounds for the variables.
neq
The number of equality constraints.
nle
The number of less than or equal inequalities.
nge
The number of greater than or equal inequalities.
nwarm
Optional: The number of warm-up repetitions before points are written to the output matrix.
nstride
Optional: The number of repetitions between each point that is written to the output matrix.
Note
The constraints must be listed as equalities first, less than or equal inequalities next, and greater than or equal inequalities last.
Preferences(pref1(value1), ...)
Preference(pref1(value1), ...)
Pref(pref1(value1), ...)
Prefs(pref1(value1), ...)
Set Preferences(pref1(value1), ...)
Set Preference(pref1(value1), ...)
Description
Sets preferences for JMP.
Arguments
Analysis Destination(window)
Specifies where to route new analyses.
Annotation Font("font", size, "style")
Font choice for annotations in reports.
Axis Font("font", size, "style")
Font choice for axis labels.
Axis Title Font("font", size, "style")
Font choice for axis titles.
Background Color( {R, G, B} | <color> )
Sets the background color for windows.
Calculator Boxing(Boolean)
Turns on boxing to show hierarchy of expressions.
Data Table Font("font", size, "style")
Font choice for data tables.
Data Table Title on Output(Boolean)
Titles reports with name of data table.
Date Title on Output(Boolean)
Titles reports with current date.
Evaluate OnOpen Scripts("always"|"never"|"prompt")
Determines whether an On Open table script is run after the user opens the data table. By default, the user is prompted. Their choice is remembered each time they open the data table in the current JMP session. Scripts that execute other programs are never run.
Excel Has Labels(Boolean)
When on, forces JMP to interpret the first row of data as column headings.
Excel Selection(Boolean)
When on, the user is prompted for which non-blank Excel worksheets should be imported from an Excel workbook.
File Location Settings(<Directory Type>("<path>"<,"initial directory">))
Valid directory types are:
Data Files Directory Sets the default location for data files.
Help Files Directory Sets the default location for help files.
Installation Directory By default, this location is set to the JMP installation folder on Windows:
"C:/Program Files/SAS/JMP/13", "C:/Program Files/SAS/JMPPro/13", or "C:/Program Files/SAS/JMPSW/13"
License File Path Sets the default location for JMP license file.
Preferences File Directory Sets the default location for the preferences settings file.
Save As Directory Sets the default location for Save As file operations.
Foreground Color(color)
Sets the foreground color for windows.
Formula Font("font", size, "style")
Font choice for the formula editor.
Graph Background Color(color)
Sets the color for the background area inside the graph frame.
Graph Marker Size(size)
Default size for drawing markers.
Heading Font("font", size, "style")
Font choice for table column headings in reports.
Initial JMP Starter Window(Boolean)
Specifies whether the JMP Starter window is shown at launch.
Initial Splash Window(Boolean)
Enables you to show or suppress the initial splash screen.
Maximum JMP Call Depth(size)
Sets the default for the maximum call depth (or stack size) for JMP. Each thread that JMP creates has a 2MB stack by default. Resetting the maximum call depth can cause a physical stack overflow.
Marker Font("font", size, "style")
Font choice for markers used in plots.
Monospaced Font("font", size, "style")
Font choice for monospaced text.
ODBC Suppress Internal Quoting(Boolean)
Prevents internal quoting in SQL statements that contain table and variable names with mixed case and spaces.
Outline Connecting Lines(Boolean)
Draws lines between titles for same-level outline nodes.
Print Settings(option(value), ... )
Changes print options on the Page Setup window:
Margins( <n>, <n>, <n>, <n>) sets the left, top, right, and bottom margins. Margins are in inches.
Margins(<n>) sets all margins to the same value in inches.
Orientation("portrait" | "landscape") changes the page’s print orientation.
Headers(<"char">, <"char">, <"char">) specifies text that appears in the left, middle, and right header.
Headers(<"char">) specifies the only text in the header.
Footers(<"char">, <"char">, <"char">) specifies text that appears in the left, middle, and right footer.
Footers(<"char">) specifies the only text in the footer.
Scale(<n>) decreases or increases the percentage at which the content prints.
Show Explanations(Boolean)
Some analyses have optional text that explains the output.
Show Menu Tips(Boolean)
Turns menu tips on or off. (Windows only)
Show Status Bar(Boolean)
Turns display of the status bar on or off.
Small Font("font", size, "style")
Font choice for small text.
Text Font("font", size, "style")
Font choice for general text in reports.
Thin Postscript Lines(Boolean)
Macintosh only. Specifies that line widths drawn to a Postscript printer be narrower than otherwise.
Title Font("font", size, "style")
Font choice for titles. Arguments are name of font (for example, "Times"), size in points, and style ("bold", "plain", "underline", "italic").
("Use Triple-S Labels as Headings")(Boolean)
When on, forces JMP to interpret label names as column headings.
Examples
The following expressions reset all preferences to their default values.
Preferences( "Default" );
Preferences( "Factory Default" );
Notes
The preferences for the following areas are not accessible in JSL: Text Data Files, Windows Specific, Macintosh OS Settings, Fonts, Communications, Script Editor, and JMP Updates. See “Platform Preferences(platform(option(value)), ...)” for information about setting platform preferences.
Register Addin("unique_id", "home_folder", <named_arguments>)
Description
Register a JMP Add-In and load the add-in if it registers successfully.
Returns
If successful, returns a scriptable object representing the registered add-in. If unsuccessful, returns Empty.
Arguments
unique_id
A quoted string that contains the unique identifier for the add-in. The string can contain up to 64 characters. The string must begin with a letter and contain only letters, numbers, periods, and underscores. Reverse-DNS names are recommended to increase the likelihood of uniqueness.
home_folder
A quoted string that contains the filepath for the folder containing the add-in files. The filepath must conform to the valid pathname requirement for the host operating system.
DisplayName( "name" )
An optional, quoted string that contains a name that can be displayed in the JMP user interface wherever add-in names are displayed, instead of the unique ID.
JMPVersion("version")
An optional string that contains a specific version of JMP. The default value is "All", which enables the add-in to be loaded and run in any version of JMP that supports add-ins. "Current" restricts the use of the add-in to only the current version. Any quoted version number (for example, "7" or "9") restricts the add-in to a single specific version of JMP.
LoadsAtStartup(Boolean)
An optional Boolean. The default value is True (1), which causes the add-in to be loaded when JMP is started. If the value is False (0), the add-in is not loaded automatically.
LoadNow(Boolean)
Loads the add-in immediately.
Note
If a file named addin.def is found in the specified home folder, values from that file are used for any optional arguments that are not included in the Register Addin() function.
Example
In the following example, the first argument is the unique identifier. The second argument identifies where the add-in is installed. The third argument is the name that appears where add-in names are displayed (for example, the View > Add-Ins menu on Windows).
Register Addin("com.company.lee.dan.MyAddIn","$DOCUMENTS/myaddin", displayname( "Calculator Addin" ));
The second argument becomes the $ADDIN_HOME path variable definition. When you refer to the add-in scripts, be sure to include a trailing slash after the path variable.
Include("$ADDIN_HOME(com.jmp.jperk.texttocols)/texttocols.jsl");
Revert Menu()
Description
Resets your JMP menus to factory defaults.
Run Program(Executable("path/filename.exe"), Options({"/a", "/b", "..."}), Read Function(expression), Write Function(expression), Parameter(expression))
Description
Runs the external program specified by the Executable argument, with the command line arguments specified by the Options argument.
Results
Returns either a string, a blob, or a Run Program object as controlled by the Read Function argument.
Arguments
Executable
The path to the executable. On Macintosh, type the full path to the executable.
Options
Command line arguments for the executable.
Read Function
If Read Function( "text" ) is specified, a text string is returned. If Read Function( "blob" ) is specified, a blob is returned. The script waits until the external program closes its stdout. Run Program then returns all data that the external program has written to its stdout as a string or a blob.
If Read Function is not specified, a Run Program object is returned.
Write Function
Optional argument that accepts a function as its value; it does not accept "text" or "blob".
Parameter
Optional argument to read and write the expression in Read Function.
Notes
Use global variables when Run Program() is inside a function.
The Run Program object, which is returned if Read Function is not specified, accepts the following messages to read data from the external program’s stdout:
<<Read: reads any available data as a string. If no data is available, an empty string is returned.
<<Can Read: returns true if there is data available to be read.
<<Is ReadEOF: returns true when the external program has completed and all its data has been read.
You can use these messages to poll for data and process the data as it is produced by the external program.
A Run Program object accepts the following messages to write data to the external program’s stdin:
<<Write( "text" ): sends data to the external program’s stdin.
<<Can Write: returns true if the external program will accept data immediately; otherwise, calling <<Write causes your script to block.
<<WriteEOF: signals to the external program that you are done sending data to it.
Instead of sending messages to the returned Run Program object, you can specify the Read Function argument as an inline function. RP is the Run Program object.
RP = Run Program(
Executable( ... ),
Read Function(
Function( {RP},
<your code here>
RP << Read
)
)
);
The Parameter(optParm) argument is optional in Read Function. If specified, the functions defined for Read Function and Write Function can receive a second argument, which is the value of optParm.
Examples
The following script is an example of the Write Function argument. RP is the Run Program object. In this context, it accepts the <<Write and <<WriteEOF messages.
RP = Run Program(
Executable( ... ),
Write Function(
Function( {RP},
<your code here>
RP << Write( "Program finished." )
)
)
);
The following script shows an example of Parameter(optParm) argument:
RP = Run Program(
Executable( ... ),
Parameter( x ),
Read Function( Function( {RP, optParm},... ) )
);
Within the Read Function, optParm contains the value of x. Do not attempt to access the optParm argument in your function if you have not specified a Parameter argument.
Schedule(n, script)
Description
Queues an event to run the script after n seconds.
Set Clipboard(string)
Description
Evaluates the "string" argument looking for a character result, and then places the string on the clipboard.
SetJVMOption( Version("13") )
Description
Sets the Java Runtime Environment (JRE) version that you want JMP to use (rather than the version installed with JMP). This script must be run before JMP connects to the JRE.
Argument
version
(Windows only) In the Windows registry, there are two requirements for the JavaSoft/Java Runtime Environment key: the key must include a string called “RuntimeLib” that points to a valid jvm.dll. And the Java Runtime Environment key must include a key named after the quoted JVM version number.
Set Platform Preference()
Set Platform Preferences()
Set Preference()
Set Preferences()
Set Toolbar Visibility( "toolbar name" | default | all, window type | all, "true" | "false" )
Description
On Windows, shows or hides a toolbar based on the window type or for all windows.
Arguments
toolbar name | default | all
The internal name of the toolbar (see the View > Toolbars list in JMP), the default toolbar for the specified window type, or all toolbars. Include quotes around "toolbar name".
window type | all
Data table, script, report, journal, or all windows.
true | false
Quoted string that shows or hides the toolbar.
Shortest Edit Script()
Description
Compares two lists, strings, matrices, or sequences. See the Scripting Index in the JMP Help menu for more detailed syntax options.
Arguments
limit
An optional argument that stops the evaluation when the edit list exceeds the specified number of inserted or deleted items.
Show Addins Dialog()
Description
Opens the Add-In Status window (View > Add-Ins).
Arguments
None.
Show Commands()
Description
Lists scriptable objects and operators. Arguments are All, DisplayBoxes, Scriptables, Scriptable Objects, StatTerms, Translations.
Show Preferences(<"all">)
Description
Shows current preferences. If no argument is specified, preferences that have been changed are shown. If "all" is given as the argument, all preferences are shown.
Show Properties(object)
Description
Shows the messages that the given object can interpret, along with some basic syntax information.
Sobol Quasi Random Sequence(nDim, nRow)
Description
Generates a sequence of space-filling quasi random numbers using the Sobol sequence in up to 4000 dimensions.
Socket(<STREAM | DGRAM>)
Description
Creates a socket.
Returns
The socket that was created.
Arguments
STREAM | DGRAM
Optional argument to specify whether the socket is a stream or datagram socket. If no argument is supplied, a stream socket is created.
Speak(text, <wait(Boolean)>)
Description
Calls system’s speech facilities to read aloud the text. If Wait is turned on, script execution pauses until speaking is done.
Status Msg("message")
Description
Writes the message string to the status bar.
Subtract(a, b)
a-b-...
Description
Subtracts the values of the listed arguments, left to right. No arguments are changed.
Returns
The difference.
Arguments
Two or more variables, numbers, or matrices.
Notes
Two or more arguments are permitted. Specifying fewer than two arguments produces an error.
See Also
The Data Structures chapter in the Scripting Guide.
Unregister Addin("unique_id")
Description
Unregisters (removes) a previously registered add-in.
Argument
unique_id
A quoted string that contains the unique identifier for the add-in to unregister.
Web(string, <JMP Window>)
Description
Opens the URL stored in string in the default system web browser. Under Microsoft Windows, you can add JMP Window as the second argument to have the HTML open in a JMP browser.
The http:// prefix in the URL is optional.
Examples
url = "www.jmp.com";
Web( url );
 
Web( "www.jmp.com" );
Web( "www.jmp.com", JMP Window );
XML Attr("attr name")
Description
Extracts the string value of an xml argument in the context of evaluating a Parse XML command
XML Decode("xml")
Description
Decodes symbols in XML to ordinary text. For example, &amp; becomes &, and &lt; becomes <.
Argument
xml
A quoted string containing XML.
XML Encode("text")
Description
Prepares text for embedding in XML. For example, & becomes &amp;, and < becomes &lt;.
Argument
xml
A quoted string containing plain text.
XML Text()
Description
Extracts the string text of the body of an XML tag in the context of evaluating a Parse XML command.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset