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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.