Hello,
I have a dataset "data1" & I create a data view "stuff" by:
libname s "filepath";
data s.stuff/view=s.stuff;
set s.data1;
run;
However, now it seems I always need "data1" to be in the folder s in order for SAS to be able read "stuff". If I move it, it won't read the data view.
The point of me creating the view was to save space by being able to remove the dataset.
Is there a way of doing this?
Thanks
It is not clear what you are asking. You obviously cannot remove the underlying data without making the view useless.
I assume that you want to store the view in a place with limited space and have it read from the actual data which is store in a place that has sufficient storage.
libname big '...disk1....';
libname little '...disk2...';
data little.x / view=little.x;
set big.x;
run;
It is not clear what you are asking. You obviously cannot remove the underlying data without making the view useless.
I assume that you want to store the view in a place with limited space and have it read from the actual data which is store in a place that has sufficient storage.
libname big '...disk1....';
libname little '...disk2...';
data little.x / view=little.x;
set big.x;
run;
From the documentation:
View
A view is a "virtual table." It does not actually exist but is a collection of rules that are used to extract data from existing tables. A view is processed in the same way as any SAS table, and its architecture is the same, with rows representing observations and columns representing variables. Because of the "virtual" nature of views, they cannot be updated.
The View could include code to read an external file referenced in an Infile statement for example. And every time the View is used the code would re-read that external file. Which might be desirable if a fixed name file is used to update things. But the data source has to exist somewhere.
If the data in question is large enough that you are worried about storage it could well be that additional time to access the data in whatever form might be excessive for actual processing.
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!
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.