Hi SAS community, I would like to write a substring that uses the variable, "number", starts at position 1 and has a length that stops at 2 places before the last digit. Please advise. This is what I have tried: data want; set have; new_number=substring(number,1,(-2)); run; I have also tried this method where I write out a separate substring for each length of the observations for the "number" variable. (This variable contains lengths ranging from 10-20). data want1; set have1; new_number1=substring(number,1,(10-2)); new_number2=substring(number,1,(11-2)); . .. .. .. new_number20=substring(number,1,(20-2)); run; Thanks.
... View more