|SAS Statements under Windows|
|Valid in:||anywhere in a SAS program|
|Windows specifics:||Valid values for command|
|See:||X Statement in SAS Language Reference: Dictionary|
places you in a Command prompt session, with an operating system prompt. Here you can execute Windows commands in the context of SAS working directory. There are some things that you cannot do from the Command prompt in this situation, such as define environment variables for use by your SAS session. (Environment variables must be defined before you invoke SAS). Type EXIT at the Command prompt and press ENTER to return to your SAS session.
specifies a Windows command or a Windows application. This argument can be anything you can specify at a DOS prompt (including the SAS command). Therefore, you can use the X statement to execute Windows applications. The command can be enclosed in quotes, but this syntax is not required.
By default, you must type EXIT to return to your SAS session after the command has completed execution. Also by default, if you execute a Windows application such as Notepad, you must close the application before you can return to your SAS session. Specify NOXWAIT in an OPTIONS statement if you do not want to have to type EXIT. With NOXWAIT in effect, as soon as the command finishes execution, control is returned to your SAS session. Note, however, that if you execute a Windows application with the X statement, specifying NOXWAIT does not let you return to your SAS session until you close the application.
Another system option, XSYNC, controls whether you have to wait for the command to finish executing before you can return to your SAS session. If you specify NOXSYNC, you can start a Windows application with the X statement and return to your SAS session without closing the application. For additional details about these two system options, see XWAIT System Option: Windows and XSYNC System Option: Windows.
The %SYSEXEC statement in Macro Statements