Skip to main Content

Moving Data Between Libraries

If you would like to move a data set from one library to another, rather than copy it, you can use the MOVE option with either Proc DATASETS or Proc COPY.

First, lets build a simple data set (TABLE1) the WORK library:

data work.table1;
  do i = 1 to 10;
    output;
  end;
run;

 

Now lets move TABLE1 into the SASUSER library with Proc DATASETS:

proc datasets lib=work;
  copy out=sasuser move;
  select table1;
quit;

 

One final example, lets move TABLE1 back into the WORK library, this time with Proc COPY:

proc copy in=sasuser out=work move;
  select table1;
run;