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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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;

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

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;
ballardw
Super User

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.

 

Brian3
Obsidian | Level 7
Thank you both, I understand better now

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 16. 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
  • 3 replies
  • 913 views
  • 2 likes
  • 3 in conversation