Chapter Contents

Previous

Next
SUBMIT

SUBMIT



Submits statements or commands to SAS for execution

Category: Submit Block


Syntax
Details
Examples
See Also

Syntax

SUBMIT<when <where>><host> <'STATUS'>;

when
specifies when to submit the generated statements or commands for execution and what action, if any, the procedure must take. If an option is not specified, the SUBMIT block statements are collected by SCL in a PREVIEW buffer. Options are

CONTINUE
specifies that at the end of the current submit block, the procedure submits all statements stored in the PREVIEW window and returns control to the SCL program. Execution of the program continues with the statement that follows ENDSUBMIT.

IMMEDIATE
specifies that at the end of the current submit block, the procedure submits all statements stored in the PREVIEW window and returns control to the procedure. You cannot use this option with FRAME entries, because its action could prevent the execution of other labeled sections.

Note:   This means that any statements following ENDSUBMIT are not executed on this pass through the SCL program. To execute the statements following ENDSUBMIT, use conditional logic to branch around the SUBMIT IMMEDIATE statement.  [cautionend]

PRIMARY
specifies that at the end of the current submit block, the procedure submits all SAS statements stored in the PREVIEW window, and the user is returned to the primary window (the entry specified with the CATALOG= option in the AF command). If the current entry is the primary entry for the application, then this option restarts the current entry.

Note:   This means that any statements following ENDSUBMIT are not executed on this pass through the SCL program. To execute the statements following ENDSUBMIT, use conditional logic to branch around the SUBMIT PRIMARY statement.  [cautionend]

TERMINATE
specifies that at the end of the current submit block, the procedure submits all SAS statements stored in the PREVIEW window and closes the AF window.

Note:   The IMMEDIATE, PRIMARY, and TERMINATE options are honored only if the where option is not specified, that is, only if statements are to be submitted to the SAS system for execution.  [cautionend]

Type: Character

where
determines where statements are submitted for execution. If this option is omitted, the statements are submitted to SAS for execution. Options are

COMMAND
submits command line commands to SAS for execution. You can specify multiple commands by separating them with semicolons. You must specify the CONTINUE option along with the COMMAND option.

EDIT
submits the statements to the Program Editor window.

Note:   In Version 8, using the RECALL command from the Program Editor window does not recall code that was submitted from SCL to the Program Editor.  [cautionend]

SQL
submits the statements to SQL for processing from both TESTAF and AF modes.

Note:   The COMMAND, EDIT, and SQL options work only with the CONTINUE option.  [cautionend]

Type: Character

host
provides instructions for submitting the code on a particular operating system. Options are

LOCAL
executes on the current system. (This is the default.)

REMOTE
executes on a remote host. Use this option with the CONTINUE option.

Type: Character

`STATUS'
is the instruction to display the status window at all times. Use this option with the CONTINUE option.

Type: Character


Details

SUBMIT labels the beginning of a block of SAS statements or commands to submit to SAS software. When SUBMIT is encountered, SCL collects all the text between SUBMIT and ENDSUBMIT and places it in the PREVIEW buffer. Based on the value of the when option, SCL submits the statements to SAS for execution at the appropriate time.

The where and host options are valid only if the when option is specified. Regardless of the value of the where option, all submit block text can be buffered in the PREVIEW window. You need to make certain that the CONTINUE option is specified when you want the statements to be submitted.

By default, when control returns to SCL, the program continues to execute the statements that follow ENDSUBMIT.

You can use the REMOTE command to override the host option of a SUBMIT statement. That is, in the SUBMIT statement, you can choose not to use the host option REMOTE and can instead use the REMOTE command to control whether the generated code is executed on the local or remote host. For more information about the REMOTE command, see Submitting Statements to a Remote Host.

The ASIS option in the CONTROL statement allows a submit block to be submitted without formatting. Use CONTROL ASIS before the SUBMIT block to submit code that contains a DATALINES statement.

When an AF application that is invoked from an autoexec file uses both SUBMIT CONTINUE REMOTE and LOCAL blocks, the order of execution may not be correct. In this situation, you can avoid problems by using the following in place of the SUBMIT CONTINUE REMOTE blocks:

submit continue;
   rsubmit;
   ...SCL statements...
   endrsubmit;
endsubmit;

Note:   If CONTROL LABEL is specified, a window variable section must not contain a SUBMIT IMMEDIATE block.  [cautionend]


Examples


See Also

ENDCLASS

PREVIEW


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.