title: data driven put with different formats challenge
body: <p>I wanted to come here with this challenge I'm facing in these days.</p>
  
  <p>Basically for each record, a different format should be used in a put statement, and it is defined in the data in theirselves.</p>
  
  <p>The challenge is not to split the datasteps and gaining the wanted result within the datastep, so avoid obvious %do loops and similar :)</p>
  
  <pre><code>proc format;
      value $a 'FRS'='FIRST';
      value $b 'SCN'='SECOND';
  run;
  data a;
      length var $3 res $10 fmt $5;
      var='FRS'; fmt='$a.'; res=''; output;
      var='SCN'; fmt='$b.'; res=''; output;
  run;
  data b;
      set a;
  
      *your code goes here, the result should go into res variable;
      *and should be the "putted" value of var using fmt as format.;
      *an obviously non working version can be found here below;
  
      res=put(var,fmt);
  run;
  </code></pre>
  
  <p>Here below what it looks like, res is the expected result:</p>
  
  <pre><code>VAR  FMT  RES
  ---------------
  "FRS" $a. =put("FRS",$a.)="FIRST"
  "SCN" $b. =put("SCN",$b.)="SECOND"
  </code></pre>