Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to copy SAS external files from one directory to another ?

Status
Not open for further replies.

6656

Programmer
Nov 5, 2002
104
US
How to copy SAS external files from one directory to another on NT in SAS step?
 
I don't know the direct solution but you can reference two different libnames pointing at different locations..for example.
/*Location where your file are residing now*/
Libname origloc "D:\Files\Projects\Project1";

/*Destination where you want to send the file to*/
Libname destLoc "D:\Files\Projects\Project2";

data destLoc.data1;
set origloc.data1;
run;

You can also lookup Proc copy or Proc cport procedures.

HTH.
 
Hi 6656,

what file types do you want to copy? If it's tables, the hints from sk1 work perfectly (attention: the data...set...run ignores any index the source table has, so target is w/o it, with v8 auditing etc. as well).

For other file types you could consider input/output using 'infile'; depending on the structure of the file have a closer look at RECFM, BLKSIZE, and LRECL options in the online help.

Cheers,
Matthias
 
THANKS ALL,

The file format is MS-Excel. I think I will use X or %sysexec statement to code MS-DOS command which may be easier. Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top