The SAS Output Delivery System and reporting techniques

Selecting Top ten rows

Accepted Solution Solved
Reply
Valued Guide
Posts: 610
Accepted Solution

Selecting Top ten rows

I have a large table that I cannot open directly in SAS due to size.  I tried selecting only the top ten rows but the query is taking forever.  Is there a reason why selecting the top ten rows would have a delay at all?

 

data myTable_temp;
set mylibrary.myTable (obs=10);
run;


Accepted Solutions
Solution
‎05-16-2016 08:25 AM
Valued Guide
Posts: 610

Re: Selecting Top ten rows

I learned that a count(*) on a few actually takes a long time.  When querying large views the idea is to use a where clause.

View solution in original post


All Replies
Super User
Posts: 13,338

Re: Selecting Top ten rows

Posted in reply to DavidPhillips2

Is your MyLibrary another database and not a native SAS data set?

Or located on a network with possible comminication issues?

Valued Guide
Posts: 610

Re: Selecting Top ten rows

How do I tell?  I see it as a SAS dataset under shared data in Enterprise Guide.

Valued Guide
Posts: 610

Re: Selecting Top ten rows

Posted in reply to DavidPhillips2

I tried doing a select count(*) that spins in Oracle on the table for five mintues with no result.

Super User
Posts: 13,338

Re: Selecting Top ten rows

Posted in reply to DavidPhillips2

DavidPhillips2 wrote:

How do I tell?  I see it as a SAS dataset under shared data in Enterprise Guide.


Assuming this is how to see what/where a library or data set may be

In Libraries under the server list right click on the library and select Properties from the menu. It will show the Path to the library and other

properties.

Solution
‎05-16-2016 08:25 AM
Valued Guide
Posts: 610

Re: Selecting Top ten rows

I learned that a count(*) on a few actually takes a long time.  When querying large views the idea is to use a where clause.

Respected Advisor
Posts: 3,167

Re: Selecting Top ten rows

Posted in reply to DavidPhillips2

Try this:

proc sql inobs=10;
create table mytable_temp as
select * from mylibrary.mytable;
quit;
🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 688 views
  • 3 likes
  • 3 in conversation