runShare Statement

Added: build 135

Purpose

Enables multiple users to access the same FileWrapper component simultaneously.

Applicability

The runShare statement can be used within RunCommands sections.

Syntax

runShare <none|wait|share|error> [autoDelete=auto|true|false][files="[file1][file2][..]"]

Arguments

Name Description
value The runShare mode. One of the following:
  • none - This option performs no run sharing. This means that when two users attempt to run the same component simultaneously, the Analysis Server will take no action to ensure that input and output files are not overwritten.
  • wait - When the component is running, this option ensures that no one else will be able to run it. A second user will not be able to read or write files until the first user is done with them. When the first user's object has retrieved all of the output information it needs from the component's files, the second user's object can now run; it overwrites the current input and output files in doing so. This is the default run sharing mechanism of FileWrapper components.
  • share - When two or more users attempt to run a component simultaneously, the FileWrapper creates separate directories that hold unique input and output files for every user. Thus, all users can run the component simultaneously without file conflicts.
  • error - When a user tries to run a component that is already running, this option generates an error message and instructs the user to try again later.

Options

Name Description
autoDelete Controls what happens to the temporary run directory after the wrapper is run. Valid values include:
  • false - do not delete the directory.
  • true - delete the directory.
  • auto - delete the directory only if an error did not occur while running the wrapper. If an error did occur, then the directory is preserved and a file named exception.log is created in the directory to record the error. If no error occurs, the directory is deleted when the component is ended or when it's run again. This the default setting.
files This argument is a space separated list of all file names that should be copied into the temporary directory at run time.  Absolute filenames are not allowed.  Files or directories to be copied must reside in the same directory as the FileWrapper itself.  Analysis Server supports the '*' wildcard but not the '?' single character wildcard.

Example

The following RunCommands section enables users to share a program called MassSpringDamper using the share option of the runShare statement . It leaves all temporary directories in the FileWrapper directory after execution. It only copies files starting with the name "msd" to those directories.
RunCommands 
{
runShare: share autoDelete=false files="msd.*"
generate inFile
run "MassSpringDamper"
parse outFile
}

See also Analysis Server | FileWrapper | FileWrapper Statements