How to convert SAS logic into a Oracle SQL syntax?
Hi Experts,
Having below algorithm in SAS I am struggling to build a code in Oracle SQL.
Could you please help me with code?
Thank you!
Estersita
--This is what I have in SAS
data mytable;
set have;
elig.DTE_Effective < to_date('01MAR2018') then elig.DTE_Effective=to_date('01MAR2018');
else if elig.DTE_Effective > to_date('30JUN2018') then elig.DTE_Effective=elig.DTE_End;
elig.DTE_END < to_date('01MAR2018') then elig.DTE_END=to_date('01MAR2018');
else if elig.DTE_END > to_date('30JUN2018') then elig.DTE_END=to_date('30JUN2018');
num_days_elig2 = datdif(datepart(dte_effective), datepart(dte_end), 'ACT/ACT') + 1;
run;
--This is what I am trying to do in SQL
CREATE TABLE mytable as
SELECT DISTINCT
Field 1.
Field2,
/*case conditions*/
/*calc line*/
FROM have
quit;
Hi Experts,
Having below algorithm in SAS I am struggling to build a code in Oracle SQL.
Could you please help me with code?
Thank you!
Estersita
--This is what I have in SAS
data mytable;
set have;
elig.DTE_Effective < to_date('01MAR2018') then elig.DTE_Effective=to_date('01MAR2018');
else if elig.DTE_Effective > to_date('30JUN2018') then elig.DTE_Effective=elig.DTE_End;
elig.DTE_END < to_date('01MAR2018') then elig.DTE_END=to_date('01MAR2018');
else if elig.DTE_END > to_date('30JUN2018') then elig.DTE_END=to_date('30JUN2018');
num_days_elig2 = datdif(datepart(dte_effective), datepart(dte_end), 'ACT/ACT') + 1;
run;
--This is what I am trying to do in SQL
CREATE TABLE mytable as
SELECT DISTINCT
Field 1.
Field2,
/*case conditions*/
/*calc line*/
FROM have
quit;