SAS.SubmitStatements

Prototypes

static void SubmitStatements( Matrix mStatements )

static void SubmitStatements( String sStatements )

static void SubmitStatements( String[] asStatements )

Parameters

Matrix mStatements
A character matrix in the shape of a vector in which each element contains SAS language statements you want to submit to the SAS server for execution.

String sStatements
A string containing SAS language statements you want to submit to the SAS server for execution. The string may contain newline characters ('\n'). IMLPlus does not impose a limit to the length of the string.

String[] asStatements
An array of strings in which each string contains SAS language statements you want to submit to the SAS server for execution. The individual strings may contain newline characters ('\n'). IMLPlus does not impose a limit to the length of the strings.

Remarks

This method submits SAS language statements to the SAS server for execution.

Because all the elements in an IML character matrix are stored with a common length, individual entries may be padded with trailing spaces. For the matrix form of this method, IMLPlus strips off trailing spaces from each matrix element before submitting the statements to SAS. If the technique of storing SAS language statements in an IML character matrix causes a problem with a particular sequence of SAS statements, use one of the other forms of this method.

A sequence of SAS language statements that is submitted to a SAS server by an IMLPlus program must contain zero or more complete DATA or PROC steps. IMLPlus does not support submitting partial DATA or PROC steps. One notable exception to this rule is that it is acceptable to use the RUN statement to execute a PROC step, although the QUIT statement is preferred. If IMLPlus detects that a sequence of SAS language statements has left SAS in a DATA or PROC step, IMLPlus forces SAS to exit the step.

IMLPlus provides a very convenient shortcut for calling the SubmitStatements method: the SUBMIT statement. When IMLPlus encounters a SUBMIT statement, it passes the program source code between the SUBMIT statement and the following ENDSUBMIT statement to the method SAS.SubmitStatements. (Note that it is still necessary to call the method SAS.SubmitStatements directly in situations where the IMLPlus program builds SAS language statements dynamically.)

Example
run GetInstallationDirectory( path );
path = path + "Data Sets";
libname samples (path);

statements = { "proc univariate data=samples.baseball noprint;"
               "var NO_HOME;"
               "output out=results skewness=skewness;"
               "quit;" };
SAS.SubmitStatements( statements );

use results;
read all var {"skewness"} into skewness;
close results;
print skewness;
See Also

SAS.SubmitCatalogEntry
SAS.SubmitFile