Please help.
I'm very new to SAS and trying to modify and existing proc.
Right now the code looks like this. I want to add a second condition the where statement so that it's picking up where transtypedesc does not equal either 'change account' or 'void account'. So I want to exclude change and void statuses. I've tried a handful of attempts to add a second condition to the where statement and keep getting errors.
inner join acct.State as d on c.LobGuid = d.LobGuid
inner join acct.loc as e on d.StateGuid = e.StateGuid
inner join acct.locItemInfo as f on e.LocGuid = f.LocGuid
where BusinessUnitCd = 'AA'
and TransTypeDesc <> 'CHANGE ACCOUNT');
quit;
Try:
where BusinessUnitCd = 'AA'
and not upcase(TransTypeDesc) in ("CHANGE ACCOUNT","VOID ACCOUNT")
;
Your current statement ended with a parenthesis, but you didn't show all of your code, thus don't know if an additional parenthesis is needed.
Try:
where BusinessUnitCd = 'AA'
and not upcase(TransTypeDesc) in ("CHANGE ACCOUNT","VOID ACCOUNT")
;
Your current statement ended with a parenthesis, but you didn't show all of your code, thus don't know if an additional parenthesis is needed.
Nice one sir. You were correct. There were two places where the end paren was not added when the original programmer added the 2nd condition. I was so busy looking at the syntax and trying to work around that and I didn't notice the issue. Unfortunately SAS EG didn't throw an error on the missing paren, like it would in VBA, it just got hung-up.
That is twice today that people have called me "Sir". I REALLY prefer "Art" these days. But, glad to see that you have identified the problem.
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.