title: SAS cutting off string during data recode
body: <p>On a dataset that is created by:</p>
  
  <pre><code>data voa;
      input Address $50.;
      input City $1-15 State $16-17 Zip;
      input Latitude Longitude;
      datalines;
  1675 C Street, Suite 201
  Anchorage      AK  99501    
  61.21       -149.89
  600 Azalea Road
  Mobile         AL  36609
  30.65       -88.15  
  </code></pre>
  
  <p>I'm attempting to add a new variable which is essential a recoding of Long and Lat, like so:</p>
  
  <pre><code>data voa1;
      set voa;
      if Longitude &lt; -110 then Region = "West";
      if Latitude &gt; 40 and Longitude &lt; -90 and Longitude &gt; -110 then Region = "Mid-West";
      if Latitude &gt; 40 and Longitude &gt; -90 then Region = "North-East";
      if Latitude &lt; 40 and Longitude &lt; -110 then Region = "South";
  run;
  </code></pre>
  
  <p>Unfortunately, it seems that SAS is cutting the strings short and leaving them at 4 characters (e.g. "Mid-West" just becomes "Mid-"). If I had to guess I would assume that this is because SAS assigns a certain number of bytes for each value in a column based on the first value in that column, and doesn't dynamically modify the number of bytes based on new values. How do I fix this?</p>
  
  <p>Note: I think a potential fix might be putting the longest potential output (in this case "North-East") first, but this seems like an inelegant solution.</p>