Need to put Length statement before the Set statement to change the length of existing variable. Use the LENGTH statement as the very first statement in the DATA STEP to declare the length of variable in the Set dataset.
thekey and program variables in the mapping dataset are both $7 in length. The following data step change the length of these two variables to $10.
data mapping; length thekey $10 program $10; set mapping; run;