BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
kajal_30
Quartz | Level 8

 

IND_F = ID1 >= ID2 >= ID3 ;

One of the program says as below can someone please help what does that mean?

They are all date values.

 

I am seeing value of IND_F = 1 for few records not sure how ? 

 

Regards

kajal

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

Below is logically the same formulated a bit more traditionally

  if (ID1 >= ID2) and (ID2 >= ID3) then IND_F =1;
  else IND_F = 0;

The code you've got is a bit more "shorthand". Everything right of the first equal sign is a logical expression for which SAS returns 1 if true and 0 if false.

 

View solution in original post

4 REPLIES 4
Astounding
PROC Star

This is a shortcut, meaning:

IND_F = (ID1 >= ID2) and (ID2 >= ID3) ;

It returns a 0 or a 1, depending on the comparisons.  When both comparisons are true, IND_F receives a value of 1.  Otherwise it receives a value of 0.

 

kajal_30
Quartz | Level 8

Thank you so much

Patrick
Opal | Level 21

Below is logically the same formulated a bit more traditionally

  if (ID1 >= ID2) and (ID2 >= ID3) then IND_F =1;
  else IND_F = 0;

The code you've got is a bit more "shorthand". Everything right of the first equal sign is a logical expression for which SAS returns 1 if true and 0 if false.

 

kajal_30
Quartz | Level 8

thank you so much 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 1170 views
  • 2 likes
  • 3 in conversation