Checks whether a session is active, or login is required.
isLoggedIn
, and a string userName
.Creates a compute context on the given server.
the name of the context to be created.
the name of the launcher context used by the compute service.
the ID of the account to run the servers for this context as.
the lines of code to execute during session initialization.
an access token for an authorized user.
an optional list of authorized user IDs.
Creates a folder at SAS file system.
name of the folder to be created.
the full path (eg /Public/example/myFolder
) of the parent folder.
the URI of the parent folder.
the access token to authorizing the request.
a client for interfacing with SAS API.
flag that indicates if target folder already exists, it and all subfolders have to be deleted. Applicable for SAS VIYA only.
Deletes a compute context on the given server.
the name of the context to be deleted.
an access token for an authorized user.
For performance (and in case of accidental error) the deleteFolder
function does not actually delete the folder (and all its content and subfolder content). Instead the folder is simply moved to the recycle bin. Deletion time will be added to the folder name.
the full path (eg /Public/example/deleteThis
) of the folder to be deleted.
an access token for authorizing the request.
Creates the folders and services at the given location appLoc
on the given server serverUrl
.
the JSON specifying the folders and services to be created.
the base folder in which to create the new folders and services. If not provided, is taken from SASjsConfig.
the server on which to deploy the folders and services. If not provided, is taken from SASjsConfig.
an optional access token to be passed in when using this function from the command line.
flag that indicates if target folder already exists, it and all subfolders have to be deleted.
Updates a compute context on the given server.
the original name of the context to be deleted.
an object with the properties to be updated.
an access token for an authorized user.
Returns a JSON representation of a compute context.
an id of the context to return.
an access token for an authorized user.
Returns a JSON representation of a compute context.
the name of the context to return.
an access token for an authorized user.
Returns the _csrf token of the current session for the API approach.
Returns the _csrf token of the current session for the WEB approach.
Returns the current SASjs configuration.
Returns the username of the user currently logged in.
Logs into the SAS server with the supplied credentials.
a string representing the username.
a string representing the password.
Logs out of the configured SAS server.
Moves folder to a new location. The folder may be renamed at the same time.
the full path (eg /Public/example/myFolder
) or URI of the source folder to be moved. Providing URI instead of path will save one extra request.
the full path or URI of the parent folder to which the sourceFolder
will be moved (eg /Public/newDestination
). To move a folder, a user has to have write permissions in targetParentFolder. Providing URI instead of path will save one extra request.
the name of the "moved" folder. If left blank, the original folder name will be used (eg myFolder
in /Public/newDestination/myFolder
for the example above). Optional field.
an access token for authorizing the request.
Makes a request to the SAS Service specified in SASjob
. The response
object will always contain table names in lowercase, and column names in
uppercase. Values are returned formatted by default, unformatted
values can be configured as an option in the %webout
macro.
the path to the SAS program (ultimately resolves to
the SAS _program
parameter to run a Job Definition or SAS 9 Stored
Process). Is prepended at runtime with the value of appLoc
.
a JSON object containing one or more tables to be sent to
SAS. Can be null
if no inputs required.
provide any changes to the config here, for instance to
enable/disable debug
. Any change provided will override the global config,
for that particular function call.
provide a function here to be called if the user is not logged in (eg to display a login form). The request will be resubmitted after logon.
Sets the debug state. Turning this on will enable additional logging in the adapter.
boolean indicating debug state (on/off).
Sets the SASjs configuration.
SASjs configuration.
Kicks off execution of the given job via the compute API.
the path to the SAS program (ultimately resolves to
the SAS _program
parameter to run a Job Definition or SAS 9 Stored
Process). Is prepended at runtime with the value of appLoc
.
a JSON object containing one or more tables to be sent to
SAS. Can be null
if no inputs required.
provide any changes to the config here, for instance to
enable/disable debug
. Any change provided will override the global config,
for that particular function call.
a valid access token that is authorised to execute compute jobs. The access token is not required when the user is authenticated via the browser.
an object representing the compute session created for the given job.
Uploads a file to the given service.
the path to the SAS program (ultimately resolves to
the SAS _program
parameter to run a Job Definition or SAS 9 Stored
Process). Is prepended at runtime with the value of appLoc
.
array of files to be uploaded, including File object and file name.
request URL parameters.
Generated using TypeDoc
SASjs is a JavaScript adapter for SAS.