i Have written below code on SAS Data flux, as there are many other True/false condition are there, in below condition everything became true assecond part of the query should be false
if ((not isnull(`FSP_KATR10`) or not isblank (`FSP_KATR10`)) and (not isnull(`DNP_KATR10`) or not isblank (`DNP_KATR10`))) or
((isnull(`FSP_KATR10`) or isblank (`FSP_KATR10`)) and (isnull(`DNP_KATR10`) or isblank (`DNP_KATR10`))) then
begin
T_F = 'true'
end
else
begin
if (not isnull(`FSP_KATR10`) or not isblank (`FSP_KATR10`)) and inlist(trim(`SYSTEM_ID_DNP`),'P48010','P24010','P45010','P47010','Q26010') and (isnull(`DNP_KATR10`) or isblank (`DNP_KATR10`)) then
begin
T_F = 'false'
`ReasonFalse` = `ReasonFalse` & "Attribute 10 on FSP but not on other SYSTEM ,"
end
else
begin
if (isnull(`FSP_KATR10`) or isblank (`FSP_KATR10`)) and inlist(trim(`SYSTEM_ID_DNP`),'P48010','P24010','P45010','P47010','Q26010') and (not isnull(`DNP_KATR10`) or not isblank (`DNP_KATR10`)) then
begin
T_F = 'false'
`ReasonFalse` = `ReasonFalse` & "Attribute 10 on other system but not on FSP ,"
end
end
end
Sorry, is there a specific question here?
Yes!, actually this code just run for all as True, where there are some false also, the false condition output also is as Ture
In order for anyone to be able to provide help, we need to see a portion of your data, as SAS data step code which you can type in yourself or follow these instructions, and not in any other format. We also need the full code you are working with, not just the IF statement. Lastly, we need a description in words of what in the provided data would make something true or false.
No worries!
Thanks for the help, i can't share more than that, no data, and full code. really sorry for that.
No worries we can close this here.
Thanks
Dheeraj
@lambad wrote:
No worries!
Thanks for the help, i can't share more than that, no data, and full code. really sorry for that.
No worries we can close this here.
Thanks
Dheeraj
Example data that duplicates the behavior. Only include the variables used in the problem code.
Other code would be needed if it also modifies the values of the variables before getting this step.
I don't use Data Flux so I do not know if your single quote characters are problematic.
In the code you show
isnull(`FSP_KATR10`)
The characters are not the stand single quote: '
The different character would make a difference is base SAS code, as in not execute.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.