BookmarkSubscribeRSS Feed
alepage
Barite | Level 11

One way to copy a dataset from let's say path1 to path2 is to use the libname and data statement as below

 

%let path1= something;
%let path2=something else;
%let fname=be_auto_prmjun2024;

libname source spde  "&path1.";
libname dest     spde  "&path2";

data dest.&fname.;
set source.&fname;
run;

if we have many files, we coud use a filelist and a call execute and repeat the above script

 

What will be the unix command that we could use to copy spde file containing only the string prm (stand for premium) from many subfolders to other subfolders and of course only spde file.

 

Please provide the good unix command

Please p

 

4 REPLIES 4
Tom
Super User Tom
Super User

Did you try PROC COPY?

 

alepage
Barite | Level 11

I have many folders such as

sas2000

sas2001

...

sas2025 

and in each sas????, I have other subfolder

What I would like to do is to copy only the premium dataset containg the string _prm

Is it possible to do that with proc copy

 

Tom
Super User Tom
Super User

@alepage wrote:

I have many folders such as

sas2000

sas2001

...

sas2025 

and in each sas????, I have other subfolder

What I would like to do is to copy only the premium dataset containg the string _prm

Is it possible to do that with proc copy

 


If you only want to copy some of the datasets use the SELECT statement.  Let SAS worry about what files are used by which dataset.

proc copy inlib=in outlib=out;
  select premium ;
run;

 

LinusH
Tourmaline | Level 20

You cannot copy/move SPDE data using OS tools.

This is because the directory path is coded into the table metadata.

See answers above for ways of copying within SAS:

Data never sleeps

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 693 views
  • 2 likes
  • 3 in conversation