BookmarkSubscribeRSS Feed
PadraigODea
Fluorite | Level 6

Hi,

 

I have created a "View" in SAS Enterprise. (My first!)

If I open a brand new project then I expect to be able to create a query based on that "view" created earlier.

 

QUESTION: Where will I find the view, what library, what server? etc?

 

 

And yes, I do have an understanding that a "view" is not real data - merely a view.


CaptureTEMP140217.JPG
6 REPLIES 6
ballardw
Super User

You should have assigned the view to a library just like a dataset. The instructions for building the view results reside in that library. If you did not specify then it was very likely placed in the WORK library. Which means that it was likely cleaned up when you ended your SAS session and  that you likely need ot re-do the work and place the view in a permanent library to avoid recreating it every time you need it.

PadraigODea
Fluorite | Level 6

Thanks,

 

I understand - almost!

 

I right-clicked on the query that creates the view and then click "properties" then click "results".

In the "results" I changed the output folder and filename to an existing library.

 

However, now when I run the query I get the following error;

 

"ERROR: The CREATE VIEW statement cannot be processed directly by the database.

ERROR: Create View failed."

 

mmmm...I am not sure what to do now??
All help appreciated.

 

 

 

ballardw
Super User

Are creating that in a library that represents an EXTERNAL database? I'm not sure how that would work. I only use SAS views associated with SAS data sets.

 

LinusH
Tourmaline | Level 20
You can definitely create views pointing to RDBMS data. SAS is really a great tool for working almost seamless with different data sources.
But the key is that you can't create a SAS view and store in a RDBMS libref. Store it in a SAS libref.
If you think it's better to store it in the RDBMS you need to create it using the target RDBMS SQL syntax either directly in the database or in a PROC SQL explicit pass through step.
Data never sleeps
PadraigODea
Fluorite | Level 6

Thanks for feedback on my "view" question.

I have been out of office for a couple of days.

 

Allow me clarify the question.

My data is static historic data with zero updates/additions.

The structure is not friendly as sometimes data is split over 5 tables when it should all be in the same table.  This makes simple queries more complex (appending 5 tables).

 

 

Question:


Option A :  Do I I create ONE new table which hold all the data from the 5 tables (duplicated)
or

Option B:  Do I create a view of the 5 tables

 

The number of records is fairly large ... which would make the option "B" "view" slower than if I created a new table?
Or is it breaking every rule in the book to create a new table?

 

 

LinusH
Tourmaline | Level 20
Views that append data usually performs well. When it comes to joining it's a different story.
On the other hand, a new table can be optimised by storing it on the most used dort order and applying indexes to it. If the data is static you could even remove the original tables if storage is a concern.
Data never sleeps

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 6 replies
  • 1833 views
  • 1 like
  • 3 in conversation