BookmarkSubscribeRSS Feed
lambad
Obsidian | Level 7

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

5 REPLIES 5
LinusH
Tourmaline | Level 20

Sorry, is there a specific question here?

Data never sleeps
lambad
Obsidian | Level 7

Yes!, actually this code just run for all as True, where there are some false also, the false condition output also is as Ture 

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
lambad
Obsidian | Level 7

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

ballardw
Super User

@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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 5 replies
  • 734 views
  • 1 like
  • 4 in conversation