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.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

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