BookmarkSubscribeRSS Feed
sagulolo
Quartz | Level 8

Hi All,

 

tried to do IF with many AND condition in dataset, but results was different. Appreciated if anyone can explain further. My code as per below:-

 

IF ID = 'XXX' AND NPL_Code = 'Y' AND Location_Code = '123456' AND 'O/S> 0'n = 'YES' THEN 

2 REPLIES 2
Kurt_Bremser
Super User

Please supply example data that illustrates where your condition did not perform as expected. Use a data step for posting your example data.

Not that avoiding all-uppercase coding and using the code-posting subwindow ("little running man" icon) improves readabilty of your code:

if ID = 'XXX' and NPL_Code = 'Y' and Location_Code = '123456' and 'O/S> 0'n = 'YES' then 
sagulolo
Quartz | Level 8
Hi KurtBremser,

Apologize for late reply. I'm have detected the root cause and fix it by myself.

Anyway thank you for your response and time.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 639 views
  • 1 like
  • 2 in conversation