BookmarkSubscribeRSS Feed
Jabbawonga
Calcite | Level 5


Hello,

I'm working through some code in an old program written by someone else, and I came across the following lines:

Proc Reg ... (where=(b1))...

and

Proc Syslin ... (where=(b3))...

I've searched the documentation and don't see any explanation regarding "where" statements in Proc Reg or Syslin or what b1 and b3 are (they are not variables in the models).  Can anybody help me understand what "where=(b1)" or "where=(b3)" mean?

Thanks.

3 REPLIES 3
Reeza
Super User

Where statements are related to the input data set.

Its the equivalent of saying:

where b1 ne 0 or b1 ne .

or where b3 ne 0 or b1 ne .

ballardw
Super User

You didn't post a whole line of code but I will bet that the (where= (b1)) immediately followed the input dataset name. This is one of many dataset options that are universal that allow selecting data, variables and renaming variables at time of execution.

Amir
PROC Star

Hi,

Some documentation on "where=(...)" data set option:

SAS(R) 9.4 Data Set Options: Reference

In your example if b1 is numeric it should either be:

a) "." (missing)

b) "0" (zero)

c) Any other number (e.g. 12, -77, etc.)

(a) & (b) would be equivalent to False (observation would not be used) and (c) would be equivalent of True (observation will be used).

E.g. the second data step uses "where=(age)" to only process a valid age value:

data test1;

  set sashelp.class;

  if name=:'J' then

    age=.;

run;

data test2;

  set test1(where=(age));

run;

Regards,

Amir.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1469 views
  • 0 likes
  • 4 in conversation