Help using Base SAS procedures

where (sintax error while parsing)

Accepted Solution Solved
Reply
Super Contributor
Posts: 301
Accepted Solution

where (sintax error while parsing)

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.


Accepted Solutions
Solution
‎02-26-2012 07:52 PM
PROC Star
Posts: 7,471

where (sintax error while parsing)

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


All Replies
PROC Star
Posts: 7,471

where (sintax error while parsing)

This one works for me:

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

Solution
‎02-26-2012 07:52 PM
PROC Star
Posts: 7,471

where (sintax error while parsing)

In addition to that sturcture:

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

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

Super Contributor
Posts: 301

where (sintax error while parsing)

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.

Super Contributor
Posts: 301

where (sintax error while parsing)

Yes, thank you. It works!

🔒 This topic is solved and locked.

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

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