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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.