title: How do I assign numeric values to the alphabet in SAS
body: <p>I'm trying to convert a character string to a numeric variable and then sum the values of each character to use as a unique identifier for that field.
  So for example, I would like A=1, B=2, C=3.....X=24  Y=25  Z=26.
  Say my string is "CAB" so after running the code I would like the result to be an intermidiary column of numbers, where the value for CAB IS   3 1 2  and the result column would be derived by summing the string 3+1+2= 6  and show the value of the intermideate column, so the final value woud be 6.</p>
  
  <p>Here is the sas code I used to convert the characters to numbers, but I need help with the result column.</p>
  
  <pre><code>DATA CHAR_VALUE;
  SET WORK.XYZ;
  CHAR_2_NUM=TRANSLATE(MY_VAR_CHAR, '1 2 3 ...24 25 26', 'A B C ...X Y Z');
  NUM_CHAR=INPUT(CHAR_2_NUM,32.);
  RUN;
  </code></pre>
  
  <p>Thanks in advance...I appreciate any help or suggestions.
  -rachel</p>