For the latest version of JMP Help, visit JMP.com/help.


Publication date: 04/30/2021

SAS Server Objects

sasconn<<Assign Libref(libref, path, engine, engine options)

Description

Assign a SAS libref on this SAS server connection.

Returns

Void.

Arguments

See SAS Assign Lib Refs("libref", "path", <"engine">, <"engine options">) in the JSL Functions section.

sasconn<<Cancel Submit()

Description

Cancels the currently running SAS Submit for this server that is presumably running asynchronously.

Returns

1 if a running submit was found and canceled; 0 otherwise.

sasconn<<Clear Log History()

Description

Clears the SAS Log history for this server.

Returns

Void.

sasconn<<Clear Output History()

Clears the SAS Output history for this server.

sasconn<<Connect(<User Name(name)>, <Password(password)>, <Prompt("Always"|"Never"|"IfNeeded")>)

Description

Attempt to reconnect a SAS server connection object that has become disconnected.

Returns

1 if the connection was successful, 0 otherwise.

Optional Named Arguments

User Name(name)

Specifies the quoted user name for the connection.

Password(password)

Specifies the quoted password for the connection.

Prompt

A quoted keyword. "Always" means always prompt before attempt to connect. "Never" means never prompt even if the connection attempt fails (just fail with an error message going to the log), and "IfNeeded" (the default) means prompt if the attempt to connect with the given arguments fails (or is not possible with the information given).

sasconn<<Deassign Libref(libref)

Description

De-assign the quoted SAS libref on this SAS server connection.

Returns

Void.

Arguments

libref

Specifies the quoted library reference.

sasconn<<Disconnect()

Description

Disconnect this SAS server connection.

Returns

Void.

sasconn<Does Module Exist(module name)

Description

Determines whether the specified SAS module exists in the SAS installation represented by the SAS connection. This can be helpful in determining whether certain SAS products are installed. The SAS DATA Step function MODEXIST is used to determine module existence. Because MODEXIST is new for SAS 9.2, this function throws an exception if it is called for a SAS connection that is not version SAS 9.2 or later.

Returns

1 if the specified module is found to exist, 0 if it does not exist.

Argument

module name

Specifies the quoted SAS module, the existence of which should be checked. Do not include any extension.

sasconn<<Export Data(dt, library, dataset, <named arguments>)

Description

Exports a JMP data table to the specified SAS data set in the specified library on the active SAS server connection.

Returns

1 if the data table was exported successfully; 0 otherwise.

Optional Named Arguments

See SAS Export Data(dt, "library", "dataset", <named_arguments>) in the JSL Functions section.

sasconn<<Get Data Sets(libref)

Description

Returns a list of the data sets defined in a SAS library on this SAS server connection.

Returns

List of strings.

Arguments

libref

Specifies the quoted SAS libref or friendly library name associated with the library for which the list of defined SAS data sets will be returned.

sasconn<<Get Error Count()

Description

Gets the count of the number of errors encountered in the previous SAS Submit.

Returns

An integer.

sasconn<<Get File(source, dest)

Description

Downloads a file from this SAS server connection.

Returns

Void.

Arguments

See SAS Get File("source", "dest", "encoding") in the JSL Functions section.

sasconn<<Get File Names(fileref)

Description

Gets a list of filenames found in the quoted fileref on this SAS server connection.

Returns

A list of strings.

Arguments

fileref

A quoted string that contains the name of fileref from which to retrieve filenames.

sasconn<<Get File Names In Path(path)

Description

Gets a list of filenames found in the quoted path on the current SAS server connection.

Returns

A list of strings.

Arguments

path

The quoted directory path on the server from which to retrieve filenames.

sasconn<<Get File Refs()

Description

Gets a list of the currently defined SAS filerefs on this SAS server connection.

Returns

A list of strings.

sasconn<<Get Librefs(<named arguments>)

Description

Gets a list of the currently defined SAS librefs on this SAS server connection.

Returns

A list of strings.

Optional Named Arguments

See SAS Get Lib Refs(<named arguments>) in the JSL Functions section.

sasconn<<Get Log()

Description

Retrieves the SAS Log from the last SAS Submit from this SAS server connection.

Returns

A string.

sasconn<<Get Option Name()

Description

Queries SAS for the value of a SAS option variable.

Returns

A string.

Example

The following script iterates through the define variables and prints out the values:

option_names = sasconn << Get Option Names();
For(i=1, i <= N Items(option_names), i++,
	option_value = sasconn << Get Option Value (option_names[i]);
	output = option_names[i] || "=" || char(option_value) || "/!n";
	Write(output);
);

sasconn<<Get Output()

Description

Retrieves the listing output from the last submission of SAS code to this SASServer object.

Returns

A string.

sasconn<<Get Results()

Description

Retrieves 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.

sasconn<<Get Submit Status()

Description

Gets the current status of a SAS Submit for this server that is presumably running asynchronously.

Returns

1 if the submit has not started; 2 if the submit is running; 3 if the submit has been canceled; 10 if the submit has completed successfully; 11 if the submit has completed with errors.

sasconn<<Get Var Info(libref, dataset, <Password(password)>)

Description

Returns information about the variables the specified SAS data set.

Required Arguments

libref

The library reference to de-assign.

dataset

The quoted name of the data set from which to retrieve variable names.

Optional Argument

Password(password)

The quoted password for the connection.

sasconn<<Get Var Names(libref, dataset, <named arguments>)

Description

Retrieves the variable names contained in the specified data set on this SAS server connection.

Returns

A list of strings.

Arguments

See SAS Get Var Names("string", <"dataset">, <password("password")>) in the JSL Functions section.

sasconn<<Get Version(<"Long">)

Description

Returns the SAS version as a string such as “9.1” or “9.2”.

Returns

A string that contains the SAS version.

Optional Argument

Long

A quoted keyword that specifies to return the long SAS version, which corresponds to the SYSVLONG SAS macro (for example, "9.02.02M0P01152009").

sasconn<<Get Work Folder()

Description

Returns the full path of the folder corresponding to the WORK library for this server.

Returns

A string that specifies the work folder path.

sasconn<<Import Data(library, dataset, <named arguments>)

Description

Imports a SAS data set from this SAS server connection into a JMP table.

Returns

A JMP Data Table object.

Arguments

See SAS Import Data("string", <"dataset">, <named arguments>) in the JSL Functions section.

sasconn<<Import Query(sqlquery, <named arguments>)

Description

Executes the requested SQL query on this SAS server connection, importing the results into a JMP data table.

Returns

A JMP data table object.

Arguments

See SAS Import Query("sqlquery", <named arguments>) in the JSL Functions section.

sasconn<<Is Connected()

Description

Determines whether this SAS Server object is currently connected to SAS.

Returns

1 if sasconn is connect, 0 otherwise.

sasconn<<Is Product Available(product name)

Description

Determines whether the quoted SAS product is both licensed and installed in the session represented by the SAS connection. The SAS DATA Step functions SYSPROD and MODEXIST are used to determine the licensed and installed status of the product.

Returns

1 if the specified product is licensed, 0 if the product is not licensed, or -1 if the specified product is not recognized by SAS. This function throws an exception if the requested product is not one for which JMP knows how to check the installed status.

Required Argument

product name

The quoted SAS product for which licensing should be checked. The product name can be specified with or without the “SAS/” prefix.

Note

The MODEXIST function is new in SAS 9.2. For SAS 9.1.3, this function only checks the license, not the installed status. In other words, for SAS 9.1.3, this function operates the same way as Is Product Licensed().

sasconn<<Is Product Licensed(product name)

Description

Determines whether the quoted SAS product is licensed in the session represented by the SAS connection. The SAS DATA Step function SYSPROD is used to determine the licensing status of the product.

Returns

1 if the specified product is licensed, 0 if the product is not licensed, or -1 if the specified product is not recognized by SAS.

Required Argument

product name

The quoted SAS product for which licensing should be checked. The product name can be specified with or without the “SAS/” prefix.

sasconn<<Kill Session(<n>)

Description

If no argument is provided, the SAS connection is immediately terminated.

Returns

Void.

Arguments

n

An optional number. The system waits n seconds for a normal shut-down before immediately terminating the SAS connection.

sasconn<<Load Text File(path, <named arguments>)

Description

Downloads the file specified in the quoted path from the active SAS server connection and retrieve its contents as a string.

Returns

String.

Arguments

See SAS Load Text File("path") in the JSL Functions section.

sasconn<<Open Log Window()

Description

Opens (or brings to the front) the SAS Log window for this server.

Returns

Void.

sasconn<<Open Output Window()

Description

Opens (or brings to the front) the SAS Output window for this server.

Returns

Void.

sasconn<<Open SAS Results()

Description

Opens the results from the previous SAS Submit. Intended to be used with asynchronous SAS submits or the use of the OnSubmitComplete option to SAS Submit to give the JSL author a way to conditionally open the results of a submit.

Returns

Void.

sasconn<<Open Submit Results()

Description

Opens all the results from the last SAS Submit command.

Returns

Void.

sasconn<<Send File(source, dest)

Description

Uploads a file to this SAS server connection.

Returns

Void.

Arguments

See SAS Send File("source", "dest", "encoding") in the JSL Functions section.

sasconn<<Submit(sas code, <named arguments>)

Description

Submits quoted SAS code to this SAS server connection.

Returns

Void.

Arguments

See SAS Submit("sasCode", <named arguments>) in the JSL Functions section.

sasconn<<Submit File(filename, <named arguments>)

Description

Submits a SAS code file to this SAS server connection.

Returns

Void.

Arguments

See SAS Submit File("filename", <named arguments>) in the JSL Functions section.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).