Publication date: 08/13/2020

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 Database Connection(db connection handle)

Description

Closes a database connection returned from Create Database Connection.

Example

Close Database Connection(db connection handle)

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.

Note

Copy Directory(path, dest, Boolean) is deprecated.

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", <Allow Undo(Boolean)>)

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.

Allow Undo

Allows undo operations, for example, moving to the Recycle Bin or Trash Can.

Delete File("path", <Allow Undo(Boolean)>)

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.

Allow Undo

Allows undo operations, for example, moving to the Recycle Bin or Trash Can.

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.

File Size(path)

Description

Determines the size of the file within the specified path.

Example

File Size( "$SAMPLE_DATA/Big Class.jmp" );

13142

Files In Directory(path, <recursive(Boolean)>)

Description

Returns a list of filenames in the path given.

Returns

List of filenames. If recursive(Boolean) is not specified, directory names are included in the list.

Arguments

path

A valid pathname.

recursive

An optional keyword that causes all folders in the path (and all folders that they contain, and so on) to be searched for files.

Note

Files In Directory(path, "recursive"|Boolean) is deprecated.

Find All(data tables|reports|journals, <invisible|private>)

Description

Finds all open files of the specified type.

Example

The following example finds all open data tables:

exdt1 = Open( "$SAMPLE_DATA/Big Class.jmp" );
exdt2 = Open( "$SAMPLE_DATA/Animals.jmp" );
windows = Find All( Data Tables );
For( i = 1, i <= N Items( windows ), i++,
	Write( Char( windows[i] << Get Window Title ) || "\!N" )
);

Big Class

Animals

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.

See Set Default Directory("path").

Returns

The absolute pathname as a string.

Arguments

none

Note

Get Default Directory() also gets the path of an active saved scripting window.

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)

Google Sheet Export(email, spreadsheet URL or ID|new spreadsheet name, sheet name)

Description

Exports a data table to a Google sheet.

Returns

“1” if the export is successful.

Arguments

email

The Google email address. (@gmail.com is unnecessary.)

spreadsheet URL or ID

The spreadsheet’s URL or ID (which precedes “spreadsheets/d/”).

new spreadsheet name

The name of the new spreadsheet that you are creating.

sheet name

The name of the sheet (or tab) within the spreadsheet.

Notes

JMP features such as formulas and List Check column properties are not supported in Google Sheets.

If the spreadsheet is empty, look in the JMP log for error messages. On Windows, select View > Log. On macOS, select Window > Log.

See About Exporting Google Sheets in Using JMP for more information about security, country restrictions, and more.

Google Sheet Import(email, spreadsheet URL or ID, <sheet names|Google Sheet settings>)

Description

Imports sheets from a Google Sheet.

Returns

A data table (or the first data table imported if several sheets are imported at once).

Arguments

email

The Google email address. (@gmail.com is unnecessary.)

spreadsheet URL or ID

The spreadsheet’s URL or ID (which precedes “spreadsheets/d/”).

sheet names

(Optional) The name of the sheet or sheets that you want to import.

sheet settings

(Optional) The settings that describe how the data is imported.

Notes

See About Importing Google Sheets in Using JMP for more information about security, country restrictions, and more.

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.

JSON to Data Table(JSON string, (<private(Boolean)>|<invisible(Boolean)>), <"Guess"(stack(Boolean)|"tall"|"wide")>

Description

Converts JSON text to a data table.

Returns

A data table reference. The parsing of an empty value, "" string, missing value, or any other invalid value returns an empty data table.

Optional Arguments

private(Boolean)

Hides the data table completely. Specify this argument if the user doesn’t need to interact with the data table.

invisible(Boolean)

Hides the data table from view but shows it in the JMP Home Window.

"Guess"(stack(Boolean))

Stack applies to nodes that repeat within a parent node that is creating rows. By default, extra values are stored in a single table cell separated by commas. If the value is 1, repeating values are stacked in extra rows. Be careful stacking data. It can cause non-obvious data errors.

"tall" imports the data in a tall data table. Select this option when the XML file contains many rows. This option is the default setting.

"wide" imports the data in a wide data table. Select this option when the XML file contains many columns.

Example

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt = JSON to Data Table(
	"[ { \!"name\!": \!"KATIE\!", \!"age\!": 12, \!"sex\!": \!"F\!", \!"height\!": 59, \!"weight\!": 95 }, { \!"name\!": \!"LOUISE\!", \!"age\!": 12, \!"sex\!": \!"F\!", \!"height\!": 61, \!"weight\!": 123 }, { \!"name\!": \!"JANE\!", \!"age\!": 12, \!"sex\!": \!"F\!", \!"height\!": 55, \!"weight\!": 74 } ]"
);

Notes

Stacking the data can cause non-obvious data errors. Values that are supposed to be in the same row might not be. Here’s an example of stacking data:

d =
"\[
{
       "toys": [{
              "Wheels": 2,
              "Color": "Red"
       },
       {
              "Wheels": 4,
              "Size": "Large"
       }]
}
]\";
 
JSON to Data Table( d, Guess( Stack( 1 ) ) );

Figure 2.1 Example of Stacking Data that Shows Errors 

The first toy should be red and have 2 wheels. The second toy should be large and have 4 wheels.

JSON to List(JSON string)

Description

Converts JSON text to a JSL list that represents the structure specified by the JSON data. The parsing of an empty value, "" string, missing value, or any other invalid value returns {}.

Example

l = JSON To List(
	"[ { \!"name\!": \!"KATIE\!", \!"age\!": 12, \!"sex\!": \!"F\!", \!"height\!": 59, \!"weight\!": 95 }, { \!"name\!": \!"LOUISE\!", \!"age\!": 12, \!"sex\!": \!"F\!", \!"height\!": 61, \!"weight\!": 123 }, { \!"name\!": \!"JANE\!", \!"age\!": 12, \!"sex\!": \!"F\!", \!"height\!": 55, \!"weight\!": 74 } ]"
);
Show( l );

JSON Literal("string")

Description

Returns a valid JSON Boolean or null constant based on the specification of the parameter. The parsing of an empty value, "" string, missing value, or any other invalid value returns Empty().

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.

JSON

Optional argument that converts JSON into an expression tree.

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 macOS, 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. See the examples in the JMP Scripting Index for more information about which arguments apply to specific file types.

Arguments

Add to Recent Files(Boolean)

Determines whether the file is added to the Recent Files list in the Home Window.

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°).

Column Names Only

opens a data table to get column names only.

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, "text", "journal", "sas", "script", "png", and "jmp"). This can be useful if your file does not have a file extension, the file extension of the file does not match the contents of the file, or you want to import a JSL BLOB. If you do not specify this string, the file opens in the default program for the file extension.

Note: The path argument should be used for a zip archive. The extension (.zip) is not required. See Zip Archives in the JSL Messages section 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 Expression Role in Using JMP for more information 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 SAS file to avoid entering it manually. The password is not encrypted. (Password-protected Microsoft Excel files cannot be imported.)

PDF Wizard

Opens a PDF file in the PDF Import Wizard, where you can control how data is 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. Creating a private data table speeds the process of getting to the data; it does not save the computer from allocating the memory necessary to hold the data table data.

Quarantine Action("Allow Scripts"|"Block Scripts"|"Do Not Open"|"Show Dialog")

Determines whether scripts run when you open downloaded data tables. Also provides an option to display a window that prompts users to examine or open the data table. If they select Examine, the scripts are disabled. See Options for Downloaded Data Tables that Contain Scripts in the Scripting Guide for examples.

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.

Note: You can import .xls worksheets from a web site by specifying worksheets arguments. .xlsx worksheets cannot be imported from a web site using Open().

XML Wizard

Opens XML files in the XML Import Wizard. If you omit this argument, the XML file opens directly as a data table.

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(dataSourceName|"Connect Dialog", "SELECT ..."|"SQLFILE..."|tableName, <invisible|private>, <outputTableName">)

Description

Opens the database indicated by dataSourceName (or opened by the user) with the SELECT , SQLFILE, or tableName arguments.

Returns

A data table named outputTableName.

Optional Arguments

invisible

Creates an invisible data table that hides the table from view but lists it in the JMP Home Window and Window menu.

private

Hides the data table completely. Creating a private data table speeds the process of getting to the data; it does not save the computer from allocating the memory necessary to hold the data table data.

outputTableName

The name of the data table in JMP.

Example

Open Database(
	"DSN=dBASE Files;DBQ=C:/Program Files/SAS/JMPPRO/15/Samples/Import Data/;",
	// SQL statement
	"SELECT HEIGHT, WEIGHT FROM Bigclass", // selected columns
	"hw" // name of the output data table
);

Parse JSON(JSON string)

Description

Converts JSON text into an associative array or list based on the structure of the JSON data. Convert the result to a list if the parsed JSON object contains more than one member. The parsing of an empty value, "" string, missing value, or any other invalid value returns Empty().

Example

The following example converts JSON into a list:

j = Parse JSON(
	"[ { \!"name\!": \!"KATIE\!", \!"age\!": 12, \!"sex\!": \!"F\!", \!"height\!": 59, \!"weight\!": 95 }, { \!"name\!": \!"LOUISE\!", \!"age\!": 12, \!"sex\!": \!"F\!", \!"height\!": 61, \!"weight\!": 123 }, { \!"name\!": \!"JANE\!", \!"age\!": 12, \!"sex\!": \!"F\!", \!"height\!": 55, \!"weight\!": 74 } ]"
);
Show( j );

j = {["age" => 12, "height" => 59, "name" => "KATIE", "sex" => "F", "weight" => 95], ["age" => 12, "height" => 61, "name" => "LOUISE", "sex" => "F", "weight" => 123], ["age" => 12, "height" => 55, "name" => "JANE", "sex" => "F", "weight" => 74]};

Pick Directory(<"prompt">, <path>, <Show Files(Boolean)>)

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, the string appears at the top of the Browse window (Windows) or the Finder window (macOS).

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 Default Directory("path")

Description

Sets the default directory, which is used for resolving relative paths.

See Get Default Directory().

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.

See Get File Search Path().

Example

Set File Search Path( {"C:/JMP/13/source", "C:/Program Files/SAS/JMPPRO/15/Samples"} );

Set Path Variable("name", <value>)

Description

Sets the path stored in the variable.

Arguments

name

The name of the variable.

value

The path.

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 Column Names

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 ) );
Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).
.