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
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.
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.
Thank you so much
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.
thank you so much
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.