I'm mainly a SAS admin and developer. I have some code provided by a statistician that runs in an Oracle database. I'm trying to figure out how to convert to SAS syntax (with PROC SQL). My problem is that I don't understand the PERCENTILE_DISC function enough to convert to relevant SAS syntax. Anyone able to help? select PARTY_NUMBER,
Min (CREDIT_CT) as CREDIT_CT_Min,
PERCENTILE_DISC(0.01) WITHIN GROUP (ORDER BY CREDIT_CT ASC) as CREDIT_CT_P1,
PERCENTILE_DISC(0.05) WITHIN GROUP (ORDER BY CREDIT_CT ASC) as CREDIT_CT_P5,
PERCENTILE_DISC(0.10) WITHIN GROUP (ORDER BY CREDIT_CT ASC) as CREDIT_CT_P10,
PERCENTILE_DISC(0.25) WITHIN GROUP (ORDER BY CREDIT_CT ASC) as CREDIT_CT_P25,
PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY CREDIT_CT ASC) as CREDIT_CT_Median,
PERCENTILE_DISC(0.75) WITHIN GROUP (ORDER BY CREDIT_CT ASC) as CREDIT_CT_P75,
PERCENTILE_DISC(0.95) WITHIN GROUP (ORDER BY CREDIT_CT ASC) as CREDIT_CT_P95,
PERCENTILE_DISC(0.99) WITHIN GROUP (ORDER BY CREDIT_CT ASC) as CREDIT_CT_P99,
Max (CREDIT_CT) as CREDIT_CT_Max,
Min (DEBIT_CT) as DEBIT_CT_Min,
PERCENTILE_DISC(0.01) WITHIN GROUP (ORDER BY DEBIT_CT ASC) as DEBIT_CT_P1,
PERCENTILE_DISC(0.05) WITHIN GROUP (ORDER BY DEBIT_CT ASC) as DEBIT_CT_P5,
PERCENTILE_DISC(0.10) WITHIN GROUP (ORDER BY DEBIT_CT ASC) as DEBIT_CT_P10,
PERCENTILE_DISC(0.25) WITHIN GROUP (ORDER BY DEBIT_CT ASC) as DEBIT_CT_P25,
PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY DEBIT_CT ASC) as DEBIT_CT_Median,
PERCENTILE_DISC(0.75) WITHIN GROUP (ORDER BY DEBIT_CT ASC) as DEBIT_CT_P75,
PERCENTILE_DISC(0.95) WITHIN GROUP (ORDER BY DEBIT_CT ASC) as DEBIT_CT_P95,
PERCENTILE_DISC(0.99) WITHIN GROUP (ORDER BY DEBIT_CT ASC) as DEBIT_CT_P99,
Max (DEBIT_CT) as DEBIT_CT_MAX,
Min (PCT_OUT) as PCT_OUT_Min,
PERCENTILE_DISC(0.01) WITHIN GROUP (ORDER BY PCT_OUT ASC) as PCT_OUT_P1,
PERCENTILE_DISC(0.05) WITHIN GROUP (ORDER BY PCT_OUT ASC) as PCT_OUT_P5,
PERCENTILE_DISC(0.10) WITHIN GROUP (ORDER BY PCT_OUT ASC) as PCT_OUT_P10,
PERCENTILE_DISC(0.25) WITHIN GROUP (ORDER BY PCT_OUT ASC) as PCT_OUT_P25,
PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY PCT_OUT ASC) as PCT_OUT_Median,
PERCENTILE_DISC(0.75) WITHIN GROUP (ORDER BY PCT_OUT ASC) as PCT_OUT_P75,
PERCENTILE_DISC(0.95) WITHIN GROUP (ORDER BY PCT_OUT ASC) as PCT_OUT_P95,
PERCENTILE_DISC(0.99) WITHIN GROUP (ORDER BY PCT_OUT ASC) as PCT_OUT_P99,
Max (PCT_OUT) as PCT_OUT_Max
from my_table
where tran_month <= add_months(to_date('20170901', 'YYYYMMDD'), -1)
and tran_month >= add_months(to_date('20170901', 'YYYYMMDD'), -12)
group by PARTY_NUMBER
order by PARTY_NUMBER;
... View more