You can connect to a SAS server and work directly with SAS data sets. Making connections and interacting with SAS data sets is scriptable through JSL. For more information, see “连接至 SAS 元数据服务器” in the Using JMP book.
First, use the Meta Connect() command to connect to a SAS metadata server:
To specify the SAS version for the metadata server, use the SASVersion named argument:
If you supply only the machine name (for example, myserver.mycompany.com) and the port, you are prompted to provide the authentication domain, your user name, and your password. You can also specify all that in JSL:
When you are finished using the SAS metadata server, use Meta Disconnect( ) to disconnect the connection. No arguments are necessary; the command closes the current metadata server connection.
Now you can send Disconnect and Connect messages to the conn object to close and open the SAS connection.
This is an example of using an object and messages with SAS server connections. You might have also connected to SAS servers using global functions. If so, the Disconnect and Connect messages do not affect those global connections. However, if there is no active global connection, that global connection is set to the connection opened by the object.
When you connect to a SAS server, use Connect Libraries to automatically connect metadata-defined libraries.
To connect specific libraries later, use the SAS Connect Libref function or Connect Libref message to a SAS server object.
After you connect to a SAS server, use the Get Lib Ref() command to view the libraries on that server:
To save a JMP data table or an imported SAS Data Set, use the SAS Export Data() command:
Get Log() returns the contents, which can be placed in a JSL variable and used like any JSL string.