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

Is it possible to view the data table for selected observations? For example, I want to view the following table for drid=1.

bayzid_0-1686193464125.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
SASKiwi
Opal | Level 21

Try a WHERE statement in the command line with VIEWTABLE open: where drid=1  

View solution in original post

9 REPLIES 9
SASKiwi
Opal | Level 21

Try a WHERE statement in the command line with VIEWTABLE open: where drid=1  

bayzid
Obsidian | Level 7

Thanks very much.

BayzidurRahman
Obsidian | Level 7

Is it also possible to display only selected variables in the view table?

PaigeMiller
Diamond | Level 26

You can hide unwanted columns in the Viewtable window. Select the column(s) you want to hide by clicking (plus optionally shift-click or ctrl-click) on the column name(s), then right-click on a column name and select Hide.

 

You can also create a VIEW which only includes the columns you want to see. Example:

 

proc sql;
    create view abc as select make,model,msrp,cylinders from sashelp.cars;
quit;

 

--
Paige Miller
bayzid
Obsidian | Level 7

thanks. It creates a new table.

I was wondering if similar thing could be done from the command line without creating a new table as my dataset is very big.

PaigeMiller
Diamond | Level 26

@bayzid wrote:

thanks. It creates a new table.

I was wondering if similar thing could be done from the command line without creating a new table as my dataset is very big.


It does NOT create a new table, it creates a VIEW. These are different. A VIEW doesn't require that a brand new (and very large) data set be created; it allows you to VIEW the data set that already exists in ways that you specify, such as it allows you to view only specified columns of this large data set.

--
Paige Miller
bayzid
Obsidian | Level 7

Thanks. got it

Ksharp
Super User
keep name
drop name


But it only can handle one variable one time.
PaigeMiller
Diamond | Level 26

@Ksharp wrote:
keep name
drop name


But it only can handle one variable one time.

Although this isn't as good a solution (in my opinion) as creating a view, this does work if you want to try it in the command line

 

 

hide type;hide drivetrain;hide origin
--
Paige Miller

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 9 replies
  • 313 views
  • 3 likes
  • 5 in conversation