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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 305 views
  • 0 likes
  • 2 in conversation