Chapter Contents

Previous

Next
X

X



Runs an operating system command or an OS/2 application from within a SAS session

Valid: anywhere in a SAS program
OS/2 specifics: Valid values for command


Syntax
Details
See Also

Syntax

X <'command'>;

no argument
places you in a Command prompt session, with an operating system prompt. Here you can execute OS/2 commands in the context of the SAS System 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 the SAS System). Type EXIT at the Command prompt and press ENTER to return to your SAS session.

command
specifies an OS/2 command or an OS/2 application. This argument can be anything you can specify at an OS/2 prompt (including the SAS command). Therefore, you can use the X statement to execute OS/2 applications. The command can be enclosed in quotes, but this is not required syntax.

The command is passed to OS/2 and executed in the context of the working directory. If errors occur, the appropriate error messages are displayed.

By default, you must type EXIT to return to your SAS session after the command has completed execution. Also by default, if you execute an OS/2 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 an OS/2 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 an OS/2 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 and XSYNC.


Details

The X statement issues a host command from within a SAS session. The SAS System executes the X statement immediately.

Under OS/2, you can issue the X statement without the command argument.

There are other ways of running operating environment commands besides the X statement (and the X command) under OS/2.

See Also


Chapter Contents

Previous

Next

Top of Page

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