OLE automation servers are SAS® sessions that are started programmatically from an external program using some tool such as Microsoft Visual Basic. Code submitted to the OLE automation server session is handled differently than code in an interactive SAS session.
When you submit a SAS/CONNECT® RSUBMIT/ENDRSUBMIT block to an OLE automation server, the interface can submit each line individually only. Ideally, the ENDRSUBMIT statement should go with the remote SAS session and not to the SAS session executing the RSUBMIT statement. However, with OLE automation submission, the ENDRSUBMIT statement is submitted to the session that is performing the process of remote submission. For example, the problem occurs when you submit the following code to an OLE automation server:
options remote=local sascmd="!sascmd";
signon;
rsubmit;
data;
run;
endrsubmit;
When this code is submitted, the following error is generated:
6 endrsubmit;
----------
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
There is no known way to handle this properly. The best approach is to change the SAS code that is submitted so that all of the code from the RSUBMIT statement to the ENDRSUBMIT statement is on one line. Here is an example:
options remote=local sascmd="!sascmd";
signon;
rsubmit; data; run; endrsubmit;
Tip: When all of the statements on one line this way, it is helpful to use a %INCLUDE statement between the RSUBMIT and ENDRSUBMIT statements if there is a lot of code between the two statements.
For example, suppose you have a DATA step that contains many statements as part of the RSBUMIT block. You can put all of the DATA step code in a flat SAS file on your operating system, and then use the %INCLUDE statement in the one RSUBMIT/ENDSUBMIT statement line, as shown below:
rsubmit; %include "/directory-path-to-data-step-file/data_step_code.sas" endrsubmit;
By using the %INCLUDE statement, you can keep everything on one line so that it can be processed properly.
For SAS users that use interactive display mode: Try submitting the code from the first example above ONE LINE AT A TIME in SAS. Doing so will help you understand how code is handled by submitting an entire block of code from the editor versus submitting it line by line (as is done by the OLE automation server interface).
Operating System and Release Information
| SAS System | Base SAS | Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
| Microsoft Windows XP 64-bit Edition | | |
| Microsoft® Windows® for x64 | | |
| OS/2 | | |
| Microsoft Windows 95/98 | | |
| Microsoft Windows 2000 Advanced Server | | |
| Microsoft Windows 2000 Datacenter Server | | |
| Microsoft Windows 2000 Server | | |
| Microsoft Windows 2000 Professional | | |
| Microsoft Windows NT Workstation | | |
| Microsoft Windows Server 2003 Datacenter Edition | | |
| Microsoft Windows Server 2003 Enterprise Edition | | |
| Microsoft Windows Server 2003 Standard Edition | | |
| Microsoft Windows Server 2003 for x64 | | |
| Microsoft Windows Server 2008 | | |
| Microsoft Windows Server 2008 for x64 | | |
| Microsoft Windows XP Professional | | |
| Windows 7 Enterprise 32 bit | | |
| Windows 7 Enterprise x64 | | |
| Windows 7 Home Premium 32 bit | | |
| Windows 7 Home Premium x64 | | |
| Windows 7 Professional 32 bit | | |
| Windows 7 Professional x64 | | |
| Windows 7 Ultimate 32 bit | | |
| Windows 7 Ultimate x64 | | |
| Windows Millennium Edition (Me) | | |
| Windows Vista | | |
| Windows Vista for x64 | | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.