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.
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;
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.
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.
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.
A quick search would have lead you to this very good paper:
https://www.lexjansen.com/wuss/2011/coders/Papers_Billings_T_73653.pdf
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.