BookmarkSubscribeRSS Feed

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;

1 REPLY 1
Tom
Super User Tom
Super User

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

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 348 views
  • 0 likes
  • 2 in conversation