UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SAS Code Fragments
Executing an operating system command from within SAS

* this example shows how you can call the operating system (in this
* example UNIX) to execute a command during your SAS program.
DATA test;
  do a = 1 to 100;
    output;
  end;
run;

data _null_;
  set test;
  file "test.txt";
  put a;
run;

x "rm test2.txt";
x "head ~/test.txt > test2.txt" ;


data test2;
  infile "test2.txt";
  input a;
run;

proc print data=test2;
run;

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California