BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kayla_Tan222
Calcite | Level 5

Hi, I have a sas data set file which is pola_201707 which is save it with my previous sas program , now I want to read it in a new sas program and then get copy the same whole sas data set but with another name  which is pcy_201707 and save it as another library name pcy2017

 

Both have the same data but just the name and the library name is different. How can I do with this?

Below is my code to read my previous saved sas data set pola_clm_mth_201707.

 

 

 

libname pl "C:\Data\DBF";

data pl.pola_201707;

set pl.pola_201707;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

You need to use the libname-statment for each library you want to use. Then use something like

data pcy2017.pcy_201707;
  set pl.pola_201707;
run;

if the dataset is small. For larger datasets using proc datasets with copy + change is recommended, see docs for examples.

View solution in original post

1 REPLY 1
andreas_lds
Jade | Level 19

You need to use the libname-statment for each library you want to use. Then use something like

data pcy2017.pcy_201707;
  set pl.pola_201707;
run;

if the dataset is small. For larger datasets using proc datasets with copy + change is recommended, see docs for examples.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 329 views
  • 0 likes
  • 2 in conversation