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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.