Yep, without seeing the errors am guessing, but copying and pasting the %let into the statement yields this: then catx(" ",mat.customer, input(put(%sysfunc(compress(&cmr_period ,"/",A)),4.)-1,$4.), "CMR") Which doesn't look right - e.g. what is the &cmr_period. Also, you have your inputs and put's mized up, input reads char into num, put outputs num as char. Might I suggest you do it bit by bit. e.g: proc sql; create table want as select input(strip(tranwrd(CMR_PERIOD,"/","")),best.) as MY_YEAR, case when ... then CALCULATED MY_YEAR else CALCULATED MY_YEAR - 1 end as ALTERED_YEAR, catx(" ",MAT.CUSTOMER,strip(put(ALTERED_YEAR,best.)),"CMR") as FINAL_RESULT ...
... View more