Look at the log for the proc format code. The value statement includes the name, options, values and assigned values. You should have gotten an error about the lines
SR=1
AR=2
1) SR and AR are your variable names, the procedure explects VALUES. This is so the same mapping can be applied to many variables with the same behavior.
2) Your ; was in the wrong place.
I misunderstood a little of what you are doing. Does your variable TYPE already exsit at the point you are recoding based on the values of AR and SR? If so the issue could well be that TYPE is NUMERIC and you are attempting to assing a TEXT value '2' or '1'.
You may need to think a bit more about what you are attempting. You state
"Note: all AR and SR values are greater than 0."
but you are attempting to set a single variable Type to two different values that conflict with the above statement.
Please provide a few rows of example input data that demonstrated all of the cases of the logic involved and what the results should look like for that example data.
It may not hurt to post the Log results of the first code you ran along with the error messages.
... View more