BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11
/* 1. Define LIBNAMEs for your folders */

LIBNAME source spde '/Temp/Alain/OP/dim/';
LIBNAME target spde '/Temp/Alain/OP/dim/old2/';

/* 2. Use PROC DATASETS to move the dataset */

PROC DATASETS LIBRARY=source;
  COPY IN=source OUT=target MOVE;                                                                                               /* MOVE copies and deletes original */
  SELECT dim_calendrier_v1 jourouvrableprovds jourouvrablenatds jourouvrableetdprovds jourouvrableetdnatds;                     /* Specify the dataset to move */
  QUIT;
RUN;

/* 3. Verify the move (optional) */

proc contents data=source._all_ nods;
run;                                      /* Check if it's gone from source */

proc contents data=target._all_ nods;
run;                                   /* Check if it's there in target */

How to modify this script if all the tables has the same password (write=po alter=po)

Please provide a working example

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
PROC Star
PROC DATASETS LIBRARY=source;
  COPY IN=source OUT=target MOVE alter = 'Mypassword';                                                                                               /* MOVE copies and deletes original */
  SELECT dim_calendrier_v1 jourouvrableprovds jourouvrablenatds jourouvrableetdprovds jourouvrableetdnatds;                     /* Specify the dataset to move */
  QUIT;
RUN;

View solution in original post

5 REPLIES 5
SASKiwi
PROC Star

You need to provide the ALTER password on the MOVE option:

SASKiwi_0-1767737683397.png

Here's the link to the SAS doc with the above COPY statement.

alepage
Barite | Level 11

Please provide an example

SASKiwi
PROC Star
PROC DATASETS LIBRARY=source;
  COPY IN=source OUT=target MOVE alter = 'Mypassword';                                                                                               /* MOVE copies and deletes original */
  SELECT dim_calendrier_v1 jourouvrableprovds jourouvrablenatds jourouvrableetdprovds jourouvrableetdnatds;                     /* Specify the dataset to move */
  QUIT;
RUN;
Kurt_Bremser
Super User
Consider using the external command (mv on UNIX) to move the files. If the move happens within the same physical filesystem, mv will only move the directory entries, which is much faster.
Ksharp
Super User
Kurt,
OP used SPDE engine, that means a sas dataset is consist of several small file which extension name is .spds9 .
If using OS command to move these .spds9 file, then this sas dataset might be ruined or corrupted.
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
  • 5 replies
  • 479 views
  • 5 likes
  • 4 in conversation