SYSTEM Function


Issues an operating environment command during a SAS session and returns the system return code

Category: Special

See: SYSTEM Function in the documentation for your operating environment.

Syntax

SYSTEM ( command )

Arguments

command

  • specifies any of the following: a system command that is enclosed in quotation marks (explicit character string), an expression whose value is a system command, or the name of a character variable whose value is a system command that is executed.

  • Operating Environment Information: See the SAS documentation for your operating environment for information on what you can specify. The system return code is dependent on your operating environment.

  • Restriction: The length of the command cannot be greater than 1024 characters , including trailing blanks.

Comparisons

The SYSTEM function is similar to the X statement, the X command, and the CALL SYSTEM routine. In most cases, the X statement, X command, or %SYSEXEC macro statement are preferable because they require less overhead. However, the SYSTEM function can be executed conditionally, and accepts expressions as arguments. The X statement is a global statement and executes as a DATA step is being compiled, regardless of whether SAS encounters a conditional statement.

Example

Execute the host command TIMEDATA if the macro variable SYSDAY is Friday .

 data _null_;     if "&sysday"="Friday" then do;        rc=system("timedata");     end;     else rc=system("errorck");  run; 

See Also

CALL Routine:

  • 'CALL SYSTEM Routine' on page 406

Statement:

  • 'X Statement' on page 1435




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net