Case Statement

Reply
anonymous_user
Posts: 0

Case Statement

Can I have some help on the case statement please, hopefully the logic of what im trying to do is clear, I just need to put it within the correct format please?

Proc sql;
Create table work.sk as
select
Product_End_Date as Product_end_date,
Term as Term,
Launch_Code as launch_code,
LTD_Pipeline as Pipeline_ytd,
LTD_Completions as Completions_ytd,
CATX(",", product_end_date, term, launchcode)as Date_Term_Prod,
Term_hedge_2 as Term_hedge_2 ,
Prepayment_rate_hedge_2 as Prepayment_rate_hedge_2,
Conversion_Rate_hedge as Conversion_Rate_hedge,
Key_hedge as Key_hedge,
Product_Term_comps as Product_Term_comps,

case
when Date_Term_Prod = Key_hedge then Conversion_Rate_hedge else 0 as Alco_pc,
Case
when Product_Term_comps = Term_hedge_2 then Prepayment_rate_hedge_2 else 0 end as prepayment

From Hedging_Dataset;
quit;

Super User
Super User
Posts: 7,035

Re: Case Statement

Posted in reply to anonymous_user

The first one is missing the END keyword before the AS keyword

Ask a Question
Discussion stats
  • 1 reply
  • 140 views
  • 0 likes
  • 2 in conversation