title: SAS Macro Proc Logistic put P-value in a dataset
body: <p>I've googled lots papers on the subject but don't seem to find what I want. I'm a beginner at SAS Macro, hoping to get some help here. 
  Here is what I want:</p>
  
  <p>I have a dataset with 1200 variables. I want a macro to run those 1199 variables as OUTCOME, and store the P-values of logistic regression in a dataset. Also the dependent variable "gender" is character, and so are the outcome variables. But I don't know how to put class statement in the macro. Here is an example of how I run it as a single procedure.</p>
  
  <pre><code> proc logistic data=Baseline_gender ;
   class gender(ref="Male") / param=ref;
   model N284(event='1')=gender ; 
   ods output ParameterEstimates=ok;
   run;
  </code></pre>
  
  <p>My idea was to create ODS output and delete the unnecessary variables other than the P-value and merge them into one dataset according to the OUTCOME variable names in the model: e.g.</p>
  
  <pre><code> Variable P-value
   A1       0.005
   A2       0.018
   ..       ....
  </code></pre>
  
  <p>I tried to play with some proc macro but I just cant get it work!!!
  I really need help on this, Thank you very much.</p>