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

Hi, using the command bar to open a dataset:

vt work.new

I would like to use the statement where in the commmand bar to search an specific character variable date: 01JAN00 , with format=date7.

I know one way to use where:

using the where stament in the viewtable, selected the variable date EQ and select <lookup distinct values> 01JAN00 and OK...it works perfectly.

But when I type  in the command bar: where date=01JAN00, it does not work, apearing the next error:

syntax error while parsing Where clause.

Anyone can help me with the right syntax for the option where in the command bar?

Thnak you.

1 ACCEPTED SOLUTION

Accepted Solutions
art297
Opal | Level 21

In addition to that sturcture:

vt sashelp.class (where=(sex eq 'M'))

maybe you need to state the date as:   date eq "01JAN2000"d

View solution in original post

4 REPLIES 4
art297
Opal | Level 21

This one works for me:

vt sashelp.class (where=(sex eq 'M'))

art297
Opal | Level 21

In addition to that sturcture:

vt sashelp.class (where=(sex eq 'M'))

maybe you need to state the date as:   date eq "01JAN2000"d

michtka
Fluorite | Level 6

It is right when the format is $x, and i am agree it works perfectly.

But,it  is not right when you are seeking a date  (it has different format) ...sas show an error saying "where clause operator requires compatible variable.

I think is something related with the format date7.

I am using the dataset sashelp.gngsm2 if you want to try.

Thnaks.

michtka
Fluorite | Level 6

Yes, thank you. It works!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 6774 views
  • 0 likes
  • 2 in conversation