<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: List of P Values for Excel Export in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/List-of-P-Values-for-Excel-Export/m-p/371791#M88826</link>
    <description>&lt;P&gt;Using a macro would shorten the code a bit since the 3 steps prior to the merge are all similar. You can add additional class variables as needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro repeated(class);
ODS OUTPUT MODELANOVA=OUTPUT;
PROC LOGISTIC DATA=PAT_LIST_FINAL;
CLASS &amp;amp;class. (REF = "0") ;
MODEL CMV_IND = &amp;amp;class.;
WHERE VLBW_YN = 'VLBW' AND VIRAL_YN = 1;
RUN;

PROC PRINT DATA=OUTPUT NOOBS;
RUN;
 
DATA &amp;amp;class._P_VLBW;
SET OUTPUT;
RUN;
%mend repeated;

*Similar code for each class variable;
%repeated(class=SEX);
%repeated(class=LOCATE);
%repeated(class=HISP);

DATA P_VLBW;
SET
SEX_P_VLBW
LOCATE_P_VLBW
HISP_P_VLBW
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 29 Jun 2017 16:23:35 GMT</pubDate>
    <dc:creator>Rwon</dc:creator>
    <dc:date>2017-06-29T16:23:35Z</dc:date>
    <item>
      <title>List of P Values for Excel Export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-P-Values-for-Excel-Export/m-p/371738#M88812</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to get the P-value for a list of 20+ diffent variables to export to excel. I've set it up in a round-about way, but was wondering if there's someway to simplify it to avoid 1000s of lines of code.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS OUTPUT MODELANOVA=OUTPUT;&lt;/P&gt;&lt;P&gt;PROC LOGISTIC DATA=PAT_LIST_FINAL;&lt;BR /&gt;CLASS SEX (REF = "0") ;&lt;BR /&gt;MODEL CMV_IND = SEX;&lt;BR /&gt;WHERE VLBW_YN = 'VLBW' AND VIRAL_YN = 1;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=OUTPUT NOOBS;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA SEX_P_VLBW;&lt;BR /&gt;SET OUTPUT;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS OUTPUT MODELANOVA=OUTPUT;&lt;/P&gt;&lt;P&gt;PROC LOGISTIC DATA=PAT_LIST_FINAL;&lt;BR /&gt;CLASS LOCATE (REF = "0") ;&lt;BR /&gt;MODEL CMV_IND = LOCATE;&lt;BR /&gt;WHERE VLBW_YN = 'VLBW' AND VIRAL_YN = 1;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=OUTPUT NOOBS;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA LOCATE_P_VLBW;&lt;BR /&gt;SET OUTPUT;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ODS OUTPUT MODELANOVA=OUTPUT;&lt;/P&gt;&lt;P&gt;PROC LOGISTIC DATA=PAT_LIST_FINAL;&lt;BR /&gt;CLASS HISP (REF = "0") ;&lt;BR /&gt;MODEL CMV_IND = HISP;&lt;BR /&gt;WHERE VLBW_YN = 'VLBW' AND VIRAL_YN = 1;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC PRINT DATA=OUTPUT NOOBS;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA HISP_P_VLBW;&lt;/P&gt;&lt;P&gt;SET OUTPUT;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA P_VLBW;&lt;BR /&gt;SET&lt;BR /&gt;SEX_P_VLBW&lt;BR /&gt;LOCATE_P_VLBW&lt;BR /&gt;HISP_P_VLBW&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 14:44:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-P-Values-for-Excel-Export/m-p/371738#M88812</guid>
      <dc:creator>Woop122</dc:creator>
      <dc:date>2017-06-29T14:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: List of P Values for Excel Export</title>
      <link>https://communities.sas.com/t5/SAS-Programming/List-of-P-Values-for-Excel-Export/m-p/371791#M88826</link>
      <description>&lt;P&gt;Using a macro would shorten the code a bit since the 3 steps prior to the merge are all similar. You can add additional class variables as needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro repeated(class);
ODS OUTPUT MODELANOVA=OUTPUT;
PROC LOGISTIC DATA=PAT_LIST_FINAL;
CLASS &amp;amp;class. (REF = "0") ;
MODEL CMV_IND = &amp;amp;class.;
WHERE VLBW_YN = 'VLBW' AND VIRAL_YN = 1;
RUN;

PROC PRINT DATA=OUTPUT NOOBS;
RUN;
 
DATA &amp;amp;class._P_VLBW;
SET OUTPUT;
RUN;
%mend repeated;

*Similar code for each class variable;
%repeated(class=SEX);
%repeated(class=LOCATE);
%repeated(class=HISP);

DATA P_VLBW;
SET
SEX_P_VLBW
LOCATE_P_VLBW
HISP_P_VLBW
;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Jun 2017 16:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/List-of-P-Values-for-Excel-Export/m-p/371791#M88826</guid>
      <dc:creator>Rwon</dc:creator>
      <dc:date>2017-06-29T16:23:35Z</dc:date>
    </item>
  </channel>
</rss>

