Author Topic: Difference between IF and Where in SAS  (Read 7730 times)

0 Members and 1 Guest are viewing this topic.

Offline sureshkumar_bh

  • Forum Member
  • Posts: 108
  • Gender: Male
  • Respect: 0
Difference between IF and Where in SAS
« on: Wed, 29 Jul 2009 »
0

CRS

  • *
  • Newbie
  • Posts: 377

  • Thank You
  • -Given: 34
  • -Receive: 167
    • View Profile
    • Email
    • Personal Message (Offline)

Sponsored Links

Hi ALL,

Whats the difference between IF & WHERE in SAS?????????

i know that IF takes the values before they enter in to PDV and where takes the values from the PDV..

Is it right? B:>

Offline Bala

  • Forum Member
  • Posts: 76
  • Gender: Male
  • Respect: 0
Re: Difference between IF and Where in SAS
« Reply #1 on: Sun, 2 Aug 2009 »
0
The major difference is that 'If' statements can be used only in data steps...

But Where can be used to filter in data and as well as in proc statements....It can be used in proc means or proc print etc...

Cheers,
Bala

"There is no speed limit in your pursuit of your goal - Just make sure you go with 100% committment !!!!!"

Offline aesha

  • Forum Member
  • Posts: 72
  • Gender: Female
  • Respect: +1
Re: Difference between IF and Where in SAS
« Reply #2 on: Mon, 3 Aug 2009 »
0
What Bala said is exactly correct
We can use IF statement only in the data set along with THEN and DO....
and coming to the WHERE statement we can use it in the dataset and also in the proc step...


IF
THEN
DO;
to modify the data,....
 
WHERE statement to filter the data...means if we need to extract particular name or particular details of the person we  use WHERE statement.

regards,
Aesha.

Offline nalini_k

  • Forum Member
  • Posts: 21
  • Respect: 0
Re: Difference between IF and Where in SAS
« Reply #3 on: Wed, 19 Aug 2009 »
0
Hi Suresh,

            I hope the following link will give you the clear idea.

               http://www2.sas.com/proceedings/sugi31/238-31.pdf

CRS

  • *
  • Newbie
  • Posts: 377

  • Thank You
  • -Given: 34
  • -Receive: 167
    • View Profile
    • Email
    • Personal Message (Offline)

Sponsored Links


 

Related Topics

  Subject / Started by Replies Last post
19 Replies
8827 Views
Last post Wed, 4 Nov 2009
by dianafrancis
18 Replies
5394 Views
Last post Tue, 21 Oct 2008
by dryathish.qa
1 Replies
718 Views
Last post Sat, 4 May 2013
by raju123




SMF 2.0.3 | SMF © 2011, Simple Machines

SimplePortal 2.3.3 © 2008-2010, SimplePortal