<?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: creating dummy variables using  Proc Glmmod and macro variables as input in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/creating-dummy-variables-using-Proc-Glmmod-and-macro-variables/m-p/565516#M158797</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/206978"&gt;@d0021&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to create dummy variables using proc glmmod. My inputs are two macro variables. Catvarlist has all the categorical variables. Varlist has all the variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting the following error with Proc GLMMOD.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;ERROR: Variable name should be either numeric or specified in the CLASS statement.&lt;BR /&gt;ERROR: No MODEL statement.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One (or more) of the variables in &amp;amp;VARLIST are character variables and so this one (or more) variable need to be also in &amp;amp;CATVARLIST.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2019 11:39:46 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-06-12T11:39:46Z</dc:date>
    <item>
      <title>creating dummy variables using  Proc Glmmod and macro variables as input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-dummy-variables-using-Proc-Glmmod-and-macro-variables/m-p/565410#M158737</link>
      <description>&lt;P&gt;I'm trying to create dummy variables using proc glmmod. My inputs are two macro variables. Catvarlist has all the categorical variables. Varlist has all the variables.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glmmod data=test outdesign=want outparm=p noprint;
class &amp;amp;catvarlist;
model Predicted = &amp;amp;varlist;
run;



/*Create rename statement automatically
THIS WILL NOT WORK IF YOUR VARIABLE NAMES WILL END UP OVER 32 CHARS*/
data p;
set p;
if _n_=1 and effname='Intercept' then var='Col1=Intercept';
else var= catt("Col", _colnum_, "=", catx("_", effname, vvaluex(effname)));
run;

proc sql;
select var into :rename_list separated by " "
from p;
quit;


/*Rename variables*/
proc datasets library=work nodetails nolist;
modify want;
rename &amp;amp;rename_list;
run;quit;


proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the following error with Proc GLMMOD.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;ERROR: Variable name should be either numeric or specified in the CLASS statement.&lt;BR /&gt;ERROR: No MODEL statement.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 21:18:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-dummy-variables-using-Proc-Glmmod-and-macro-variables/m-p/565410#M158737</guid>
      <dc:creator>d0021</dc:creator>
      <dc:date>2019-06-11T21:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: creating dummy variables using  Proc Glmmod and macro variables as input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-dummy-variables-using-Proc-Glmmod-and-macro-variables/m-p/565414#M158740</link>
      <description>Show your macro variable and the log as well, with the MPRINT and SYMBOLGEN code.</description>
      <pubDate>Tue, 11 Jun 2019 21:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-dummy-variables-using-Proc-Glmmod-and-macro-variables/m-p/565414#M158740</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-06-11T21:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: creating dummy variables using  Proc Glmmod and macro variables as input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-dummy-variables-using-Proc-Glmmod-and-macro-variables/m-p/565433#M158750</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/206978"&gt;@d0021&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to create dummy variables using proc glmmod. My inputs are two macro variables. Catvarlist has all the categorical variables. Varlist has all the variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc glmmod data=test outdesign=want outparm=p noprint;
class &amp;amp;catvarlist;
model Predicted = &amp;amp;varlist;
run;



/*Create rename statement automatically
THIS WILL NOT WORK IF YOUR VARIABLE NAMES WILL END UP OVER 32 CHARS*/
data p;
set p;
if _n_=1 and effname='Intercept' then var='Col1=Intercept';
else var= catt("Col", _colnum_, "=", catx("_", effname, vvaluex(effname)));
run;

proc sql;
select var into :rename_list separated by " "
from p;
quit;


/*Rename variables*/
proc datasets library=work nodetails nolist;
modify want;
rename &amp;amp;rename_list;
run;quit;


proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting the following error with Proc GLMMOD.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;ERROR: Variable name should be either numeric or specified in the CLASS statement.&lt;BR /&gt;ERROR: No MODEL statement.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please advise.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sounds like you have a Character variable in &amp;amp;varlist that is &lt;STRONG&gt;not&lt;/STRONG&gt; in &amp;amp;catvarlist&lt;/P&gt;
&lt;P&gt;Examine your variable characteristics.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2019 22:30:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-dummy-variables-using-Proc-Glmmod-and-macro-variables/m-p/565433#M158750</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-06-11T22:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: creating dummy variables using  Proc Glmmod and macro variables as input</title>
      <link>https://communities.sas.com/t5/SAS-Programming/creating-dummy-variables-using-Proc-Glmmod-and-macro-variables/m-p/565516#M158797</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/206978"&gt;@d0021&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to create dummy variables using proc glmmod. My inputs are two macro variables. Catvarlist has all the categorical variables. Varlist has all the variables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am getting the following error with Proc GLMMOD.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;ERROR: Variable name should be either numeric or specified in the CLASS statement.&lt;BR /&gt;ERROR: No MODEL statement.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One (or more) of the variables in &amp;amp;VARLIST are character variables and so this one (or more) variable need to be also in &amp;amp;CATVARLIST.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 11:39:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/creating-dummy-variables-using-Proc-Glmmod-and-macro-variables/m-p/565516#M158797</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-06-12T11:39:46Z</dc:date>
    </item>
  </channel>
</rss>

