title: Sas, print unique values for many variables
body: <p>If I have a dataset A like this:</p>
  
  <pre><code>a b c
  1 1 1
  2 1 2
  2 2 1
  3 1 2
  3 2 2
  </code></pre>
  
  <p>For columns a and b I want to print the unique values in one operation (in my real dataset I have 40 columns I want to print the unique values for.</p>
  
  <p>I can do it in sql with this command:</p>
  
  <pre><code>proc sql;
  create table test as
  select distinct a from
  A
  </code></pre>
  
  <p>But then I have to run it for every variable, which takes a lot of time. I really want to print out the unique values on this format:</p>
  
  <pre><code>a 1 2 3
  b 1 2
  </code></pre>
  
  <p>or even better</p>
  
  <pre><code>a b
  1 1
  2 2
  3 .
  </code></pre>
  
  <p>If it could be possible to put all the variable names and loop through each of them and print the unique variables, I would be very happy</p>
  
  <p>Is that possible in SAS. I do not need the full solution. Only to be pointed in the correct direction.</p>