BookmarkSubscribeRSS Feed
michtka
Fluorite | Level 6

Hi,

anyone can help me to write the next syntax in the command bar of the sas toolbox:

OnceI I open a dataset typing in the command bar

vt work.new

I would like to know what is the right syntax I need to type in the command bar to:

1. keep only the variables: age subjid sex race

2. drop the variables: usubjid dob nationality

3. select an specific observation: for example observation number 36,

4. select a number of observations: for example from 36 to 57.

Thanks in advance.

4 REPLIES 4
art297
Opal | Level 21

I don't think you can do all of that, via commands, with vt.  However, you can with FSView, which can also be called from the command prompt.  Take a look at: http://communities.sas.com/message/102793#102793

michtka
Fluorite | Level 6

Hi, thanks art.

after a quick search, i found this:

1. We can use

columns 'age subjid sex race' .

2. we can use hide 'usubjid dob nationality'

If we want to recovery the variables again we can type unhide in the command var.

3. and 4 is more complicate because I just read that viewtable (VT) dont support first obs= and obs.= statements Smiley Sad

Maybe fsview can support it, I need to search more.

Tom
Super User Tom
Super User

You can use a WHERE statement on VT.

Why would you want to look at particular rows unless those rows correspond to particular values of some variables in dataset?

michtka
Fluorite | Level 6

it just to go to the specific row where I found the uniqual value comparing two datasets that have to be the same Tom.

Just, pointed out straight forward the missmatch of the row 4567 in a dataset of 65000 row, for example.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 4 replies
  • 1615 views
  • 0 likes
  • 3 in conversation