06-28-2016 05:25 AM
Hi I need help in writing a SAS PRC SQL Script please -
I need to say -
if substr(loan_type,1,1) <> "B" then repayment_strategy_for_IO_PP = 'SP' else repayment_strategy_for_IO_PP = the rest of the data
Thanks in advance
06-28-2016 05:30 AM
case when substr(loan_type,1,1) <> "B" then 'SP' else x.repayment_strategy_for_IO_PP end as repayment_strategy_for_IO_PP,
where x is the alias for the contributing dataset, set in the "from" part.
06-28-2016 05:36 AM
I have written my code like this, but getting errors so i'm assuming I haven't written it out as you would expect?
create table work.score_2 as
case when substr(loan_type,1,1) <> "B"
end as repayment_strategy_for_IO_PP,
06-28-2016 05:51 AM
I need to make sure that if -
1. Property = residential
2. Repayment Method = Interest only and Part repayment
3. Then repayment strategy = Sale of Mortgage Property
else bring back everything else.
So the variables are -
Loan_Type = 'R'
Type_of_loan IN 'R','P'
repayment_strategy_for_IO_PP = 'SP'
But I need to make sure that if the criteria isn't hit above, that the rest of the case present as normal if that makes sense
06-28-2016 08:44 AM