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

Hi all,

 

Today, when running the code on SAS Base 9.4, I got this error, could you please help me to identify what it is and how to overcome it

443  /* Add one-day-ahead eta */
444  options mergenoby=nowarn;
445  data previous_replace/view=previous_replace;
446      merge previous_replace previous_replace
447      (firstobs=2 keep=eta rename=(eta=eta_lead1));
448  run;

ERROR: UPDATE views are not supported.
NOTE: View not saved due to errors.

Warm regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

You can't have view and dataset the SAME name .

 

data previous_replace;
 set sashelp.class;
run;



options mergenoby=nowarn;
  data previous_replace_view /view=previous_replace_view ;
      merge previous_replace previous_replace
      (firstobs=2 keep=age rename=(age=eta_lead1));
  run;

View solution in original post

5 REPLIES 5
Shmuel
Garnet | Level 18

What data type is previous_replace ? is it DATA or VIEW ?

If it is VIEW then the message clarifies itself: 

ERROR: UPDATE views are not supported.

A view holds the code, not the data, so it may be used as input only.

 

If previous_replace was DATA type then your code would work without error.

Phil_NZ
Barite | Level 11

Hi @Shmuel 

 

The previous_place dataset on the merge line is a dataset. And I try to create a view previous_place  by merging two datasets previous_place on merge statement.

 

Warm regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
Shmuel
Garnet | Level 18

suppose mylib.table is a view and a data at same time.

doing SET mylib.table - which one would sas read?

 

You can't save a view in same the name as existing data. 

 

Ksharp
Super User

You can't have view and dataset the SAME name .

 

data previous_replace;
 set sashelp.class;
run;



options mergenoby=nowarn;
  data previous_replace_view /view=previous_replace_view ;
      merge previous_replace previous_replace
      (firstobs=2 keep=age rename=(age=eta_lead1));
  run;

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!

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
  • 5 replies
  • 1436 views
  • 5 likes
  • 4 in conversation