title: How to insert dash symbols into character variables (SAS)?
body: <p>So in SAS I have a length 10 character-type variable <code>fooword</code>. What I want to accomplish is that when a custom format is applied</p>
  
  <pre><code>format fooword $fooformat.;
  </code></pre>
  
  <p>dash symbols are displayed after every two symbols (from right to left). In other words <strong>BERRY</strong> would look like <strong>B-ER-RY</strong> and <strong>STRAWBERRY</strong> would look like <strong>ST-RA-WB-ER-RY</strong>. </p>
  
  <p>Surely I can create a new longer variable and add dashes by using a bunch of <code>substr()</code> but that looks like a terrible solution in my eyes.</p>
  
  <p>So...</p>
  
  <pre><code>proc format;
      value $fooformat
      ???
      ;
  run;
  </code></pre>