As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Difference between revisions of "Tips:Use X Commands within a SAS Program to Issue Commands to Windows or MS-DOS"

From sasCommunity
Jump to: navigation, search
m
m
Line 20: Line 20:
 
- You can have as many CATEGORY tag lines as you want.
 
- You can have as many CATEGORY tag lines as you want.
 
-->
 
-->
 +
<noinclude>
 
[[Category: Base SAS]]
 
[[Category: Base SAS]]
 
[[Category: X Statement]]
 
[[Category: X Statement]]

Revision as of 20:58, 22 April 2014

X commands can be used to make directories, move files, or even launch applications like MS Word or WinZip. The system options NOXWAIT and NOXSYNC are used to close the DOS window after the command executes, and to keep the SAS session active, respectively:

options noxwait noxsync;
***create a file folder;
x "%str(md %"D:\Staff\Mary Otterness\&sysdate9.%" )";

***activate WinZip and zip all of the sas datasets in a folder;
x " ""D:\Program Files\WinZip\WINZIP32.EXE"" -a
	""D:\My files\my zipped data &sysdate9..zip"" 
	""D:\My files\*.sas7bdat"" ";

***launch MS Word;
X '"D:\Program Files\Microsoft Office\OFFICE11\WINWORD.exe"';

Note that the commands above should be modified to reflect the locations of applications on your own computer.

....see also

....see also


Submitted By Otterm1