<?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: Include target variable in PROC GLM to run thousands of univariate regression in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664405#M78979</link>
    <description>&lt;DIV&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;&amp;nbsp;I ran my code on 3 variables over 250k random obs:&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT OUT= vars DATAFILE= './summary.xls'
DBMS=xls REPLACE;
GETNAMES=YES;
RUN;

/* Use PROC SQL to create a macro variable (MissingVarList) that contains
the list of variables that have a property such as missing values */
RSUBMIT;
proc sql noprint;
select Variable,NLevels into :VarList separated by ' ', :nlevel
from vars
where NLevels = 3;
quit;
%put &amp;amp;=VarList;

/* 1. transpose from wide (Y, X1 ,...,X10000) to long (varNum VarName Y Value) */
data Long;
set proj.original; /* &amp;lt;== specify data set name HERE */
array x [*] &amp;amp;VarList; /* &amp;lt;== specify explanatory variables HERE */
do varNum = 1 to 3;
VarName = vname(x[varNum]); /* variable name in char var */
Value = x[varNum]; /* value for each variable for each obs */
output;
end;
drop &amp;amp;VarList;
run;


/* 2. Sort by BY-group variable */
proc sort data=Long; by VarName; run;

ods graphics off;
ods exclude all;
proc glm data=Long outest=PE;
CLASS Value;
by VarName;
model target = Value / RSQUARE;
quit;
ods exclude none;

/* Look at the results */
proc print data=PE(obs=5 keep=VarName Intercept Value _RSQ_);
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;here's my log file after transpose (summary importing is working correctly):&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;31 /* 1. transpose from wide (Y, X1 ,...,X10000) to long (varNum VarName Y Value) */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;54 data Long;&lt;/DIV&gt;&lt;DIV&gt;55 set proj.original; /* &amp;lt;== specify data set name HERE */&lt;/DIV&gt;&lt;DIV&gt;56 array x [*] &amp;amp;VarList; /* &amp;lt;== specify explanatory variables HERE */&lt;/DIV&gt;&lt;DIV&gt;57 do varNum = 1 to 3;&lt;/DIV&gt;&lt;DIV&gt;58 VarName = vname(x[varNum]); /* variable name in char var */&lt;/DIV&gt;&lt;DIV&gt;59 Value = x[varNum]; /* value for each variable for each obs */&lt;/DIV&gt;&lt;DIV&gt;60 output;&lt;/DIV&gt;&lt;DIV&gt;61 end;&lt;/DIV&gt;&lt;DIV&gt;65 drop &amp;amp;VarList;&lt;/DIV&gt;&lt;DIV&gt;66 run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;NOTE: There were 250000 observations read from the data set PROJ.ORIGINAL.&lt;/DIV&gt;&lt;DIV&gt;NOTE: The data set WORK.LONG has 750000 observations and 10027 variables.&lt;/DIV&gt;&lt;DIV&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV&gt;real time 17.61 seconds&lt;/DIV&gt;&lt;DIV&gt;cpu time 17.61 seconds&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;68&lt;/DIV&gt;&lt;DIV&gt;69 /* 2. Sort by BY-group variable */&lt;/DIV&gt;&lt;DIV&gt;70 proc sort data=Long; by VarName; run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;NOTE: There were 750000 observations read from the data set WORK.LONG.&lt;/DIV&gt;&lt;DIV&gt;NOTE: The data set WORK.LONG has 750000 observations and 10027 variables.&lt;/DIV&gt;&lt;DIV&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/DIV&gt;&lt;DIV&gt;real time 38.00 seconds&lt;/DIV&gt;&lt;DIV&gt;cpu time 59.61 seconds&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;71&lt;/DIV&gt;&lt;DIV&gt;72&lt;/DIV&gt;&lt;DIV&gt;73 ods graphics off;&lt;/DIV&gt;&lt;DIV&gt;74 ods exclude all;&lt;/DIV&gt;&lt;DIV&gt;75 proc glm data=Long outest=PE;&lt;/DIV&gt;&lt;DIV&gt;------&lt;/DIV&gt;&lt;DIV&gt;22&lt;/DIV&gt;&lt;DIV&gt;76&lt;/DIV&gt;&lt;DIV&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, ALPHA, DATA, MANOVA,&lt;/DIV&gt;&lt;DIV&gt;MULTIPASS, NAMELEN, NOPRINT, ORDER, OUTSTAT, PLOTS.&lt;/DIV&gt;&lt;DIV&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/DIV&gt;&lt;DIV&gt;76 CLASS Value;&lt;/DIV&gt;&lt;DIV&gt;77 by VarName;&lt;/DIV&gt;&lt;DIV&gt;78 model target = Value / RSQUARE;&lt;/DIV&gt;&lt;DIV&gt;-------&lt;/DIV&gt;&lt;DIV&gt;22&lt;/DIV&gt;&lt;DIV&gt;202&lt;/DIV&gt;&lt;DIV&gt;ERROR: No data set open to look up variables.&lt;/DIV&gt;&lt;DIV&gt;NOTE: The previous statement has been deleted.&lt;/DIV&gt;&lt;DIV&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, ALIASING, ALPHA, CLI, CLM,&lt;/DIV&gt;&lt;DIV&gt;CLPARM, COVBYCLASS, E, E1, E2, E3, E4, EST, I, INTERCEPT, INVERSE, NOINT, NOUNI,&lt;/DIV&gt;&lt;DIV&gt;P, PREDICTED, SINGULAR, SOLUTION, SS1, SS2, SS3, SS4, TOLERANCE, X, XPX, ZETA.&lt;/DIV&gt;&lt;DIV&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/DIV&gt;&lt;DIV&gt;79 quit;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;NOTE: PROCEDURE GLM used (Total process time):&lt;/DIV&gt;&lt;DIV&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV&gt;cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;80 ods exclude none;&lt;/DIV&gt;&lt;DIV&gt;81&lt;/DIV&gt;&lt;DIV&gt;91&lt;/DIV&gt;&lt;DIV&gt;92 /* Look at the results */&lt;/DIV&gt;&lt;DIV&gt;93 proc print data=PE(obs=5 keep=VarName Intercept Value _RSQ_);&lt;/DIV&gt;&lt;DIV&gt;ERROR: File WORK.PE.DATA does not exist.&lt;/DIV&gt;&lt;DIV&gt;94 run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;/DIV&gt;&lt;DIV&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV&gt;cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;94 ! quit;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;ID&amp;nbsp; &amp;nbsp; TARGET&amp;nbsp; &amp;nbsp;VAR1&amp;nbsp; ...&amp;nbsp; VAR10000&amp;nbsp; VarNum&amp;nbsp; VarName&amp;nbsp; &amp;nbsp; Value&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1&amp;nbsp; &amp;nbsp;&amp;nbsp;var1_level1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var2&amp;nbsp; &amp;nbsp;&amp;nbsp;var2_level1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var3&amp;nbsp; &amp;nbsp; var3_level1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;4&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1&amp;nbsp; &amp;nbsp; var1_level2&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var2&amp;nbsp; &amp;nbsp; &amp;nbsp;var2_level2&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var3&amp;nbsp; &amp;nbsp; &amp;nbsp;var3_level1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;7&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1&amp;nbsp; &amp;nbsp; var1_level1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var2&amp;nbsp; &amp;nbsp; var2_level2&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;9&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var3&amp;nbsp;&amp;nbsp; &amp;nbsp;var3_level2&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 23 Jun 2020 17:35:59 GMT</pubDate>
    <dc:creator>mh2t</dc:creator>
    <dc:date>2020-06-23T17:35:59Z</dc:date>
    <item>
      <title>Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664103#M78955</link>
      <description>&lt;P&gt;I have 2 datasets; &lt;STRONG&gt;original&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TARGET&amp;nbsp; &amp;nbsp;myVAR1&amp;nbsp;myVAR2&amp;nbsp; myVAR3&amp;nbsp; myVAR4&amp;nbsp; &amp;nbsp;...&amp;nbsp; &amp;nbsp; myVAR10000&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and &lt;STRONG&gt;summary&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;varNames&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NLevels&amp;nbsp; &amp;nbsp;NMissing&amp;nbsp;&lt;/P&gt;&lt;P&gt;myVAR1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;100&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;myVAR2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 50&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;myVAR3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 10&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;myVAR10000&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to run thousands of univariate regression by PROC GLM, but all of my predictors are categorical variables and my TARGET variable is numeric and TARGET is in the original dataset only, and &lt;STRONG&gt;not&lt;/STRONG&gt; in 'summary.xls'. I cannot add it to my array, because array should contain the variables of the same type. I don't know how to include my TARGET in the proc glm, so I'm able to run thousands regressions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code that I'm able to try so far is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;* select desired variables from summary table;&lt;BR /&gt;proc import out=vars datafile = 'tables/summary.xls' DBMS = xls replace;&lt;BR /&gt;     GETNAMES = YES;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;     select varNames, NLevels into :VarList separated by ' ', :nlevel     &lt;BR /&gt;     from vars&lt;BR /&gt;     where NLevels &amp;gt; 2;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;/* 1. transpose from wide (Y, X1 ,...,X1000) to long (varNum VarName Y Value) */
data Long;
set original;                       
array x [*] &amp;amp;VarList;        
do varNum = 1 to dim(x);
   VarName = vname(x[varNum]);  /* variable name in char var */
   Value = x[varNum];           /* value for each variable for each obs */
   output;
end;
drop x:;
run;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* 2. Sort by BY-group variable */&lt;/SPAN&gt;
&lt;SPAN&gt;proc sort&lt;/SPAN&gt; &lt;SPAN&gt;data&lt;/SPAN&gt;=Long;  &lt;SPAN&gt;by&lt;/SPAN&gt; &lt;SPAN&gt;VarName&lt;/SPAN&gt;;  &lt;SPAN&gt;run&lt;/SPAN&gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;/* 3. Call PROC REG and use BY statement to compute all regressions */&lt;BR /&gt;&lt;/SPAN&gt;ods graphics off;&lt;BR /&gt;ods exclude all;
&lt;SPAN&gt;proc GLM&lt;/SPAN&gt; &lt;SPAN&gt;data&lt;/SPAN&gt;=Long;&lt;BR /&gt;CLASS Value;
&lt;SPAN&gt;by&lt;/SPAN&gt; &lt;SPAN&gt;VarName&lt;/SPAN&gt;;
model TARGET = Value;&lt;BR /&gt;ods output ParameterEstimates = PEOut;
&lt;SPAN&gt;quit&lt;/SPAN&gt;;&lt;BR /&gt;ods exclude none;
&amp;nbsp;
&lt;SPAN&gt;/* Look at the results */&lt;/SPAN&gt;
&lt;SPAN&gt;proc print&lt;/SPAN&gt; &lt;SPAN&gt;data&lt;/SPAN&gt;=PE&lt;SPAN&gt;(&lt;/SPAN&gt;obs=&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;;
&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;VarName&lt;/SPAN&gt; Intercept Value;
&lt;SPAN&gt;run&lt;/SPAN&gt;;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Desired output:&lt;/P&gt;&lt;P&gt;obs&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VarName&amp;nbsp; &amp;nbsp;Intercept&amp;nbsp; &amp;nbsp;Value&amp;nbsp; &amp;nbsp;R2&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myVAR1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; xx&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myVAR2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xxx&amp;nbsp; &amp;nbsp; &amp;nbsp;xx&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myVAR3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xxx&amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp;&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myVAR4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xxx&amp;nbsp; &amp;nbsp; &amp;nbsp;xx&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; myVAR5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xxx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xxx&amp;nbsp; &amp;nbsp; &amp;nbsp;xx&lt;/P&gt;&lt;P&gt;...&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;....&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ....&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;....&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm very new to SAS. Your help would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 00:11:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664103#M78955</guid>
      <dc:creator>mh2t</dc:creator>
      <dc:date>2020-06-23T00:11:35Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664123#M78956</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;The overall programming approach is sound. But since variable &lt;EM&gt;value&lt;/EM&gt; in your long dataset is categorical, you will get an observation for every level of &lt;EM&gt;value&lt;/EM&gt; in the ParameterEstimates output dataset. If what you are interested in is the RSquare, you should request the &lt;/FONT&gt;&lt;FONT size="4"&gt;FitStatistics table in the ODS OUTPUT statement. You might also want to look at the ModelANOVA and OverallANOVA output tables.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;On the statistics side, if you are going to fit that many ANOVAs, you should worry about spurious correlations. Unless you have a huge number of observations, there is almost certainly a predictor that will yield a fabulous fit, just by chance.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 02:43:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664123#M78956</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-06-23T02:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664124#M78957</link>
      <description>&lt;P&gt;My main concern is how to include TARGET variable into the code which is numeric.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 02:47:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664124#M78957</guid>
      <dc:creator>mh2t</dc:creator>
      <dc:date>2020-06-23T02:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664143#M78958</link>
      <description>&lt;P&gt;What problem did you encounter? Please show the log for one or two variables.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 05:32:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664143#M78958</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-06-23T05:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664247#M78965</link>
      <description>&lt;P&gt;Would following your transpose with a merge on VarName solve the issue of getting the response variable into the analysis dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are some other considerations.&amp;nbsp; The dataset PEout will only contain the&amp;nbsp; values of the parameter estimates.&amp;nbsp; If you want Rsquared values you will also have to output FitStatistics.&amp;nbsp; These two datasets will have to be merged on the BY variable to get what you want for your PROC PRINT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, consider looking at information criteria (AIC, corrected AIC) as a measure of fit.&amp;nbsp; A larger number of levels for the categorical variable is going to artificially inflate the R-squared values. To get these, you would have to run the regressions in a likelihood based program (GENMOD, MIXED, etc.), but they would give you some idea of how much information is preserved from the raw data in the modeled results.&amp;nbsp; Just a thought.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 12:03:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664247#M78965</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-06-23T12:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664271#M78966</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;for your response. I don't know how to merge response variable with VarName in Long dataset.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 13:28:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664271#M78966</guid>
      <dc:creator>mh2t</dc:creator>
      <dc:date>2020-06-23T13:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664283#M78968</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;my problem is that, I don't know how to include the response variable (TARGET) from original table.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;suggested to merge TARGET on VarName in Long table, which not sure how to implement it in SAS.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 13:42:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664283#M78968</guid>
      <dc:creator>mh2t</dc:creator>
      <dc:date>2020-06-23T13:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664300#M78969</link>
      <description>&lt;P&gt;You shouldn't have to do the merge.&amp;nbsp; Your transposition code should be keeping Target (since it is not in the DROP statement).&amp;nbsp; It may be that the code needs some refinement.&amp;nbsp; Please do the following: Given the first 3 records of &lt;STRONG&gt;original&lt;/STRONG&gt;, what does the output of &lt;STRONG&gt;Long&lt;/STRONG&gt; look like, following your code? Show the input (suitably truncated to 3 or 4 myVar's since 10K myVar's values would give 50K lines in &lt;STRONG&gt;Long&lt;/STRONG&gt;) and the first 10 lines of Long, as well as the log.&amp;nbsp; From that we should be able to come up with the refinements you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 14:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664300#M78969</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-06-23T14:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664309#M78970</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I'm trying to run thousands of univariate regression by PROC GLM&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Taking a step back, I know you want code to do this, but I'm wondering if there really is a good reason to run thousands of univariate regressions. What is the benefit? What will you do with them once you have them?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If your x-variable is categorical and your y-variable is continuous, maybe you could use PROC SUMMARY to get the means and standard deviations to see if the group means are different (provided you don't run out of memory), and this will give you the ability to do one more computation to compare the means. This ought to be the equivalent to your univariate regressions. And much simpler to program. But again, why?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 14:27:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664309#M78970</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-23T14:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664340#M78971</link>
      <description>&lt;P&gt;Excellent point&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;. As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats&lt;/a&gt;&amp;nbsp;mentioned, some of these regressions are going to be highly significant, if it were done regressing a continuous variable on a continuous independent variable and the independent variable was simply a random sample of numbers.&amp;nbsp; Now consider that with categorical variables, there are N-1 regression coefficients for a categorical variable with N levels.&amp;nbsp; Without ever doing the regression, I can say that the analyses with N large (and it looks like there are some where N&amp;gt;100) are going to give a higher Rsquared than analyses with a small number of levels.&amp;nbsp; For example, look at the difference in Rsquared for a simple regression, a regression for the same data but on a 2 level class variable, and a regression for the same data on a 60 level class variable:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data two;
call streaminit(23062020);
do i = 1 to 100;
	x = rand('uniform');
	y = 2 + 3*x + 0.1*rand('uniform');
	if x&amp;gt;0.5 then group=1;
	else group=2;
	grp3 = floor(100*x);
	output;
	end;
run;

proc glm data=two;
model y= x/solution;
quit;
run;

proc glm data=two;
class group;
model y=group/solution ;
quit;
run;

proc glm data=two;
class grp3;
model y=grp3/solution ;
quit;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The Rsquared values for the three scenarios are 0.9988, 0.6967 and 0.9995.&amp;nbsp; So just by making the grouping more granular, I greatly increased Rsquared, to the point it is indistinguishable from the continuous case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OK - that is a long way around Robin Hood's barn to saying (as did&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;) - why?&amp;nbsp; What is the benefit?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 15:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664340#M78971</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-06-23T15:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664394#M78976</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;I ran my code on 3 variables over 250k random obs:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT OUT= vars DATAFILE= './summary.xls'
            DBMS=xls REPLACE;
     GETNAMES=YES;
RUN;

/* Use PROC SQL to create a macro variable (MissingVarList) that contains
   the list of variables that have a property such as missing values */
RSUBMIT;
proc sql noprint;                              
 select Variable,NLevels into :VarList separated by ' ', :nlevel
 from vars
 where NLevels = 3;
quit;
%put &amp;amp;=VarList;

/* 1. transpose;
data Long;
set proj.original;             /* &amp;lt;== specify data set name HERE  */
array x [*] &amp;amp;VarList;        /* &amp;lt;== specify explanatory variables HERE */
do varNum = 1 to 3;
   VarName = vname(x[varNum]);  /* variable name in char var */
   Value = x[varNum];          /* value for each variable for each obs */
   output;
end;
drop &amp;amp;VarList;
run;


/* 2. Sort by BY-group variable */
proc sort data=Long;  by VarName;  run;

ods graphics off;
ods exclude all;
proc glm data=Long outest=PE;
   CLASS Value;
   by VarName;
   model target = Value / RSQUARE;
quit;
ods exclude none;

/* Look at the results */
proc print data=PE(obs=5 keep=VarName Intercept Value _RSQ_);
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;here's my log file after transpose (summary importing is working correctly):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;31 /* 1. transpose from wide (Y, X1 ,...,X10000) to long (varNum VarName Y Value) */&lt;/P&gt;&lt;P&gt;54 data Long;&lt;BR /&gt;55 set proj.original; /* &amp;lt;== specify data set name HERE */&lt;BR /&gt;56 array x [*] &amp;amp;VarList; /* &amp;lt;== specify explanatory variables HERE */&lt;BR /&gt;57 do varNum = 1 to 3;&lt;BR /&gt;58 VarName = vname(x[varNum]); /* variable name in char var */&lt;BR /&gt;59 Value = x[varNum]; /* value for each variable for each obs */&lt;BR /&gt;60 output;&lt;BR /&gt;61 end;&lt;BR /&gt;65 drop &amp;amp;VarList;&lt;BR /&gt;66 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 250000 observations read from the data set PROJ.ORIGINAL.&lt;BR /&gt;NOTE: The data set WORK.LONG has 750000 observations and 10027 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 17.61 seconds&lt;BR /&gt;cpu time 17.61 seconds&lt;/P&gt;&lt;P&gt;68&lt;BR /&gt;69 /* 2. Sort by BY-group variable */&lt;BR /&gt;70 proc sort data=Long; by VarName; run;&lt;/P&gt;&lt;P&gt;NOTE: There were 750000 observations read from the data set WORK.LONG.&lt;BR /&gt;NOTE: The data set WORK.LONG has 750000 observations and 10027 variables.&lt;BR /&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;BR /&gt;real time 38.00 seconds&lt;BR /&gt;cpu time 59.61 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;71&lt;BR /&gt;72&lt;BR /&gt;73 ods graphics off;&lt;BR /&gt;74 ods exclude all;&lt;BR /&gt;75 proc glm data=Long outest=PE;&lt;BR /&gt;------&lt;BR /&gt;22&lt;BR /&gt;76&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, ALPHA, DATA, MANOVA,&lt;BR /&gt;MULTIPASS, NAMELEN, NOPRINT, ORDER, OUTSTAT, PLOTS.&lt;BR /&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;BR /&gt;76 CLASS Value;&lt;BR /&gt;77 by VarName;&lt;BR /&gt;78 model target = Value / RSQUARE;&lt;BR /&gt;-------&lt;BR /&gt;22&lt;BR /&gt;202&lt;BR /&gt;ERROR: No data set open to look up variables.&lt;BR /&gt;NOTE: The previous statement has been deleted.&lt;BR /&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, ALIASING, ALPHA, CLI, CLM,&lt;BR /&gt;CLPARM, COVBYCLASS, E, E1, E2, E3, E4, EST, I, INTERCEPT, INVERSE, NOINT, NOUNI,&lt;BR /&gt;P, PREDICTED, SINGULAR, SOLUTION, SS1, SS2, SS3, SS4, TOLERANCE, X, XPX, ZETA.&lt;BR /&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;BR /&gt;79 quit;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE GLM used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;80 ods exclude none;&lt;BR /&gt;81&lt;BR /&gt;91&lt;BR /&gt;92 /* Look at the results */&lt;BR /&gt;93 proc print data=PE(obs=5 keep=VarName Intercept Value _RSQ_);&lt;BR /&gt;ERROR: File WORK.PE.DATA does not exist.&lt;BR /&gt;94 run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;94 ! quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my Long dataset looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;TARGET&amp;nbsp; &amp;nbsp;VAR1&amp;nbsp; ...&amp;nbsp; &amp;nbsp; VAR10000&amp;nbsp; VarNum&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; VarName&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Value&lt;/P&gt;&lt;P&gt;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var1_level1&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var2_level1&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var3_level1&lt;/P&gt;&lt;P&gt;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var1_level2&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var2_level2&lt;/P&gt;&lt;P&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var3_level1&lt;/P&gt;&lt;P&gt;7&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var1_level1&lt;/P&gt;&lt;P&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var2_level2&lt;/P&gt;&lt;P&gt;9&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var3_level2&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 17:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664394#M78976</guid>
      <dc:creator>mh2t</dc:creator>
      <dc:date>2020-06-23T17:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664405#M78979</link>
      <description>&lt;DIV&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15363"&gt;@SteveDenham&lt;/a&gt;&amp;nbsp;&amp;nbsp;I ran my code on 3 variables over 250k random obs:&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT OUT= vars DATAFILE= './summary.xls'
DBMS=xls REPLACE;
GETNAMES=YES;
RUN;

/* Use PROC SQL to create a macro variable (MissingVarList) that contains
the list of variables that have a property such as missing values */
RSUBMIT;
proc sql noprint;
select Variable,NLevels into :VarList separated by ' ', :nlevel
from vars
where NLevels = 3;
quit;
%put &amp;amp;=VarList;

/* 1. transpose from wide (Y, X1 ,...,X10000) to long (varNum VarName Y Value) */
data Long;
set proj.original; /* &amp;lt;== specify data set name HERE */
array x [*] &amp;amp;VarList; /* &amp;lt;== specify explanatory variables HERE */
do varNum = 1 to 3;
VarName = vname(x[varNum]); /* variable name in char var */
Value = x[varNum]; /* value for each variable for each obs */
output;
end;
drop &amp;amp;VarList;
run;


/* 2. Sort by BY-group variable */
proc sort data=Long; by VarName; run;

ods graphics off;
ods exclude all;
proc glm data=Long outest=PE;
CLASS Value;
by VarName;
model target = Value / RSQUARE;
quit;
ods exclude none;

/* Look at the results */
proc print data=PE(obs=5 keep=VarName Intercept Value _RSQ_);
run;quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;here's my log file after transpose (summary importing is working correctly):&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;31 /* 1. transpose from wide (Y, X1 ,...,X10000) to long (varNum VarName Y Value) */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;54 data Long;&lt;/DIV&gt;&lt;DIV&gt;55 set proj.original; /* &amp;lt;== specify data set name HERE */&lt;/DIV&gt;&lt;DIV&gt;56 array x [*] &amp;amp;VarList; /* &amp;lt;== specify explanatory variables HERE */&lt;/DIV&gt;&lt;DIV&gt;57 do varNum = 1 to 3;&lt;/DIV&gt;&lt;DIV&gt;58 VarName = vname(x[varNum]); /* variable name in char var */&lt;/DIV&gt;&lt;DIV&gt;59 Value = x[varNum]; /* value for each variable for each obs */&lt;/DIV&gt;&lt;DIV&gt;60 output;&lt;/DIV&gt;&lt;DIV&gt;61 end;&lt;/DIV&gt;&lt;DIV&gt;65 drop &amp;amp;VarList;&lt;/DIV&gt;&lt;DIV&gt;66 run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;NOTE: There were 250000 observations read from the data set PROJ.ORIGINAL.&lt;/DIV&gt;&lt;DIV&gt;NOTE: The data set WORK.LONG has 750000 observations and 10027 variables.&lt;/DIV&gt;&lt;DIV&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV&gt;real time 17.61 seconds&lt;/DIV&gt;&lt;DIV&gt;cpu time 17.61 seconds&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;68&lt;/DIV&gt;&lt;DIV&gt;69 /* 2. Sort by BY-group variable */&lt;/DIV&gt;&lt;DIV&gt;70 proc sort data=Long; by VarName; run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;NOTE: There were 750000 observations read from the data set WORK.LONG.&lt;/DIV&gt;&lt;DIV&gt;NOTE: The data set WORK.LONG has 750000 observations and 10027 variables.&lt;/DIV&gt;&lt;DIV&gt;NOTE: PROCEDURE SORT used (Total process time):&lt;/DIV&gt;&lt;DIV&gt;real time 38.00 seconds&lt;/DIV&gt;&lt;DIV&gt;cpu time 59.61 seconds&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;71&lt;/DIV&gt;&lt;DIV&gt;72&lt;/DIV&gt;&lt;DIV&gt;73 ods graphics off;&lt;/DIV&gt;&lt;DIV&gt;74 ods exclude all;&lt;/DIV&gt;&lt;DIV&gt;75 proc glm data=Long outest=PE;&lt;/DIV&gt;&lt;DIV&gt;------&lt;/DIV&gt;&lt;DIV&gt;22&lt;/DIV&gt;&lt;DIV&gt;76&lt;/DIV&gt;&lt;DIV&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, (, ALPHA, DATA, MANOVA,&lt;/DIV&gt;&lt;DIV&gt;MULTIPASS, NAMELEN, NOPRINT, ORDER, OUTSTAT, PLOTS.&lt;/DIV&gt;&lt;DIV&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/DIV&gt;&lt;DIV&gt;76 CLASS Value;&lt;/DIV&gt;&lt;DIV&gt;77 by VarName;&lt;/DIV&gt;&lt;DIV&gt;78 model target = Value / RSQUARE;&lt;/DIV&gt;&lt;DIV&gt;-------&lt;/DIV&gt;&lt;DIV&gt;22&lt;/DIV&gt;&lt;DIV&gt;202&lt;/DIV&gt;&lt;DIV&gt;ERROR: No data set open to look up variables.&lt;/DIV&gt;&lt;DIV&gt;NOTE: The previous statement has been deleted.&lt;/DIV&gt;&lt;DIV&gt;ERROR 22-322: Syntax error, expecting one of the following: ;, ALIASING, ALPHA, CLI, CLM,&lt;/DIV&gt;&lt;DIV&gt;CLPARM, COVBYCLASS, E, E1, E2, E3, E4, EST, I, INTERCEPT, INVERSE, NOINT, NOUNI,&lt;/DIV&gt;&lt;DIV&gt;P, PREDICTED, SINGULAR, SOLUTION, SS1, SS2, SS3, SS4, TOLERANCE, X, XPX, ZETA.&lt;/DIV&gt;&lt;DIV&gt;ERROR 202-322: The option or parameter is not recognized and will be ignored.&lt;/DIV&gt;&lt;DIV&gt;79 quit;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;NOTE: PROCEDURE GLM used (Total process time):&lt;/DIV&gt;&lt;DIV&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV&gt;cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;80 ods exclude none;&lt;/DIV&gt;&lt;DIV&gt;81&lt;/DIV&gt;&lt;DIV&gt;91&lt;/DIV&gt;&lt;DIV&gt;92 /* Look at the results */&lt;/DIV&gt;&lt;DIV&gt;93 proc print data=PE(obs=5 keep=VarName Intercept Value _RSQ_);&lt;/DIV&gt;&lt;DIV&gt;ERROR: File WORK.PE.DATA does not exist.&lt;/DIV&gt;&lt;DIV&gt;94 run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV&gt;NOTE: PROCEDURE PRINT used (Total process time):&lt;/DIV&gt;&lt;DIV&gt;real time 0.00 seconds&lt;/DIV&gt;&lt;DIV&gt;cpu time 0.00 seconds&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;94 ! quit;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;ID&amp;nbsp; &amp;nbsp; TARGET&amp;nbsp; &amp;nbsp;VAR1&amp;nbsp; ...&amp;nbsp; VAR10000&amp;nbsp; VarNum&amp;nbsp; VarName&amp;nbsp; &amp;nbsp; Value&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1&amp;nbsp; &amp;nbsp;&amp;nbsp;var1_level1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;2&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var2&amp;nbsp; &amp;nbsp;&amp;nbsp;var2_level1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;3&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var3&amp;nbsp; &amp;nbsp; var3_level1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;4&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1&amp;nbsp; &amp;nbsp; var1_level2&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;5&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var2&amp;nbsp; &amp;nbsp; &amp;nbsp;var2_level2&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;6&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var3&amp;nbsp; &amp;nbsp; &amp;nbsp;var3_level1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;7&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Var1&amp;nbsp; &amp;nbsp; var1_level1&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;8&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var2&amp;nbsp; &amp;nbsp; var2_level2&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;9&amp;nbsp; &amp;nbsp; &amp;nbsp; yyy&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;xx&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Var3&amp;nbsp;&amp;nbsp; &amp;nbsp;var3_level2&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 Jun 2020 17:35:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664405#M78979</guid>
      <dc:creator>mh2t</dc:creator>
      <dc:date>2020-06-23T17:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Include target variable in PROC GLM to run thousands of univariate regression</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664432#M78980</link>
      <description>&lt;P&gt;Well, it looks like the data is correctly shaped (at least to me). The error in the PROC GLM call arises from including outest=PE at this point.&amp;nbsp; This looks like a relic from PROC REG code.&amp;nbsp; In GLM, so far as I can tell, you have to use an ODS OUTPUT statement. To get parameter estimates and Rsquared, you would need this&lt;/P&gt;
&lt;P&gt;ODS OUTPUT ParameterEstimates=ParameterEstimates FitStatistics=FitStatistics.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get the estimates and Rsquared into the same dataset, you will have to do some shaping, and then a many-to-one merge or sql join, as you will have a lot of lines of parameter estimates for each by variable, but only one line in FitStatistics with the Rsquared value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SteveDenham&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 18:34:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Include-target-variable-in-PROC-GLM-to-run-thousands-of/m-p/664432#M78980</guid>
      <dc:creator>SteveDenham</dc:creator>
      <dc:date>2020-06-23T18:34:55Z</dc:date>
    </item>
  </channel>
</rss>

