10-17-2013 05:21 PM
Hi, I need to know how to move a table in a library in a server to another library in another server.
I have a table in the library Work in the server SASMain and I need to copy or move it to the library Work but in another server named PSASD01. How could I do that?
I was looking for a possible answer but I found this kind of code:
LIBNAME lib1 'SAS-data-library';
LIBNAME lib2 'SAS-data-library';
COPY IN=lib1 OUT=lib2 MOVE;
SELECT member1 member2;
where 'SAS-data-library' is replaced by a path in the pc as 'C:\temp', but in my case is not a path in my computer but it's a libray in a server. Thanks in advance!
10-17-2013 05:27 PM
Can you access that in windows explorer? IE, I might have a NAS store in:
that I could just open in Windows Explorer. If I can do that (on the machine running SAS, whether that's your local server/installation or you have a windows or whatever server running SAS that you use EG to connect to), then you can just write the libname that way:
libname servlib "//mycompanysnas/sasfiles/myfolder/projectname/";
Then you can use it as a normal library - proc copy to your heart's content.
If you can't access it directly, you'll want to provide more information - are you running this locally or on a SAS Server; does this other server also have a SAS server running; are you using SAS CONNECT, Enterprise Guide, etc.?
10-18-2013 09:58 AM
Hi Reeza, in the lower part, I suppose is the status bar or something like that appears: "
, connected to PAMLP01:8561/Foundation". Also, when you check the SASMain properties, PALMP01 appears as the host name (SASMain is the server from where I want to copy the table).
10-18-2013 10:01 AM
If you are using SAS Enterprise Guide, you can use Data->Download SAS Data Sets and then Data->Upload SAS Data Sets to copy the data from your source library to your PC, then from your PC to your target library. That is two hops, but the file transfer is pretty fast as long as you have a good network connection.
04-21-2015 10:32 AM
am trying to move tables from one libarary to another library in SAS 9.2 (solaris 5.10)
How can i do that,please can you give the steps
I would really appreciate for all your help
04-21-2015 11:39 AM
both are in same sas session i tried this but its not moving any tables
here QOC11 and POC12 are my two libaries
and qoc and tlib12 are librefs
I tried to move one table AVG_DIFFS_FROM_TARGETS shown below
LIBNAME qoc 'QOC11';
LIBNAME tlib12 'POC12';
COPY IN=qoc OUT=tlib12 MOVE;
04-21-2015 12:38 PM
You don't need librefs for libraries. Put the library names directly into proc copy or datasets.
PROC datasets library=work nodetails nolist;
COPY IN=QOC12 OUT=POC12;
04-21-2015 02:11 PM
Thanks alot for your prompt reply
I got below error when i ran the above
COPY IN=QOC12 OUT=Testlib;
NOTE: Enter RUN; to continue or QUIT; to end the procedure.
ERROR 22-322: Syntax error, expecting one of the following: ;, ALTER, CLONE, CONSTRAINT, DATECOPY, FORCE, IN, INDD, INDEX, INLIB,
MEMTYPE, MOVE, MT, MTYPE, NOCLONE, OUT, OUTDD, OUTLIB, PROTECT, PW.
ERROR 76-322: Syntax error, statement will be ignored.
04-21-2015 06:49 PM
Your proc copy is incorrect, the in/out are on the same line as proc copy. Or use proc datasets.
Both of the ones below work.
Also, in the future please ask a new question rather than post in a question that is 2 years old.
libname test '/folders/myfolders';
proc copy library=work;
copy out=test in=sashelp;
select class cars heart;
proc copy out=test in=sashelp;
10-18-2013 10:05 AM
Copying data between servers, and especially to a specific work-library, doesn't sound like a best practice.
If this is one time shot, just copy in a windows explorer, or whatever tool that is available to you.
What will you do with the table in the other work? Are you using EG in both these servers? Can't get the full picture here...