I am trying to convert an Access query into a SAS SQL. I have struggled with converting the following SQL statement in Access to SAS:
IIf([LCLSTACK-BKY].Unit="OVEC-K Min" Or [LCLSTACK-BKY].Unit="OVEC-K Max" Or [LCLSTACK-BKY].Unit="OVEC-L Min" Or [LCLSTACK-BKY].Unit="OVEC-L Max" Or [CompanyOwner]="OMU" And [CounterParty]=" KU","PP",IIf([CompanyOwner]="MarketP","PU","PG")) AS MW_Type
What is the best way to code the above in SAS SQL?
SAS is mainly ANSI SQL.
I'm not very familiar with MS Access SQL, but is this conditional assignments?
Doesn't look the full query, I'm missing Select and From clauses.
To use conditional assignments, use the case - when - then - else construct.
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!
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.