BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
alepage
Barite | Level 11
libname src1 spde "/...prod/2023/05/Ep";

proc datasets lib=src1;

/* Changing the name of the dataset */
change
ep_agi_202312=ep_agi_202305 ep_ax_202312=ep_ax_202305 ep_be_202312=ep_be_202305 ep_gc_202312=ep_gc_202305 ep_gcna_202312=ep_gcna_202305 ep_ha_202312=ep_ha_202305 ep_je_202312=ep_je_202305 ep_nx_202312=ep_nx_202305
 ep_tot_202312_ibnrengine=ep_tot_202305_ibnrengine ep_tr_202312=ep_tr_202305 ep_wc_202312=ep_wc_202305 ep_wu_202312=ep_wu_202305 rsa_hist_prem_202312_cum=rsa_hist_prem_202305_cum rsa_prm_202312=rsa_prm_202305
 rsa_prm_202312_tna_v1=rsa_prm_202305_tna_v1 rsa_prm_202312_tna_v1_currentyr=rsa_prm_202305_tna_v1_currentyr rsa_prm_202312_tna_v1_cyr_sum=rsa_prm_202305_tna_v1_cyr_sum rsa_prm_202312_tna_v3_old_accyr=rsa_prm_202305_tna_v3_old_accyr
 rsa_prm_202312_tna_v3_old_yr=rsa_prm_202305_tna_v3_old_yr tot_ep_202312_v1=tot_ep_202305_v1
;
quit; 
run;

ERROR: The file SRC1.RSA_PRM_202312 (memtype=ALL) was not found, but appears on a CHANGE statement.
ERROR: The file SRC1.RSA_PRM_202312_TNA_V3_OLD_ACCYR (memtype=ALL) was not found, but appears on a CHANGE statement.
ERROR: The file SRC1.RSA_PRM_202312_TNA_V3_OLD_YR (memtype=ALL) was not found, but appears on a CHANGE statement.
NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: Due to ERROR(s) above, SAS set option OBS=0, enabling syntax check mode.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

The answer to the question is yes but there are caveats.

External databases probably will not allow SAS to rename tables because then users of that database would no longer have the tables they need the native database scripts/programs to run. Or the database admins have not given you the permissions needed to rename / delete or other modifications of existing tables.

 

In general if the data set (or view or catalog ) does not exist then you can't rename it.

 

An example that you should be able to run that creates 3 data sets in your WORK library where you should have all permissions needed and then renames them to demonstrate that it is possible.

proc sort data=sashelp.class
          out=work.agesort;
  by age;
run;

proc sort data=sashelp.class
          out=work.sexsort;
  by sex;
run;

proc sort data=sashelp.class
          out=work.heightsort;
  by height;
run;

proc datasets library=work;
   change agesort=sortage sexsort=sortsex heightsort=sortheight;
run;
quit;

 

 

 

 

View solution in original post

1 REPLY 1
ballardw
Super User

The answer to the question is yes but there are caveats.

External databases probably will not allow SAS to rename tables because then users of that database would no longer have the tables they need the native database scripts/programs to run. Or the database admins have not given you the permissions needed to rename / delete or other modifications of existing tables.

 

In general if the data set (or view or catalog ) does not exist then you can't rename it.

 

An example that you should be able to run that creates 3 data sets in your WORK library where you should have all permissions needed and then renames them to demonstrate that it is possible.

proc sort data=sashelp.class
          out=work.agesort;
  by age;
run;

proc sort data=sashelp.class
          out=work.sexsort;
  by sex;
run;

proc sort data=sashelp.class
          out=work.heightsort;
  by height;
run;

proc datasets library=work;
   change agesort=sortage sexsort=sortsex heightsort=sortheight;
run;
quit;

 

 

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 387 views
  • 0 likes
  • 2 in conversation