<?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: only variables in MODEL statements prior to the first RUN statement are available in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/only-variables-in-MODEL-statements-prior-to-the-first-RUN/m-p/518656#M3599</link>
    <description>&lt;P&gt;PROC REG is an interactive proc. This means you can continue to submit MODEL statements after the RUN statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC REG also does row wise removal of data when any variable in the VAR or MODEL statement is missing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It only keeps the variables in the MODEL or VAR statement. So if the variable has not been used in the MODEL or VAR statement before the first RUN it cannot be used in the next step because it may not account for the missing values correctly. Or at least that's my guess as to why it's this way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can just list all the variables in the VAR statement to get around this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt;*does not work;&lt;/STRONG&gt;&lt;/FONT&gt;
proc reg data=sashelp.cars;
model msrp = invoice cylinders mpg_city mpg_highway;
run;
model msrp = weight invoice cylinders;
run;quit;

&lt;FONT size="5" color="#339966"&gt;&lt;STRONG&gt;*does work;&lt;/STRONG&gt;&lt;/FONT&gt;
proc reg data=sashelp.cars;
var msrp invoice cylinders mpg_city mpg_highway weight;
model msrp = invoice cylinders mpg_city mpg_highway;
run;
model msrp = weight invoice cylinders;
run;quit;
&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/249944"&gt;@benepoko&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,guys,&lt;/P&gt;
&lt;P&gt;Here are my codes,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC REG DATA=DATASET;&lt;/P&gt;
&lt;P&gt;MODEL Y = X M C1 C2;&lt;/P&gt;
&lt;P&gt;TITLE 'REG OF Y';&lt;/P&gt;
&lt;P&gt;RUN;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;MODEL&amp;nbsp;M = X D E XD XE;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;TITLE 'REG OF M';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;QUIT;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;THE ERROR MESSAGE IN LOG IS"only variables in the VAR statement or in MODEL statements prior to the first RUN statement are available"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is there any wrong in my codes?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Dec 2018 03:26:07 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-12-05T03:26:07Z</dc:date>
    <item>
      <title>only variables in MODEL statements prior to the first RUN statement are available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/only-variables-in-MODEL-statements-prior-to-the-first-RUN/m-p/518630#M3595</link>
      <description>&lt;P&gt;Hi,guys,&lt;/P&gt;&lt;P&gt;Here are my codes,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC REG DATA=DATASET;&lt;/P&gt;&lt;P&gt;MODEL Y = X M C1 C2;&lt;/P&gt;&lt;P&gt;TITLE 'REG OF Y';&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MODEL&amp;nbsp;M = X D E XD XE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;TITLE 'REG OF M';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;QUIT;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;THE ERROR MESSAGE IN LOG IS"only variables in the VAR statement or in MODEL statements prior to the first RUN statement are available"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is there any wrong in my codes?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 02:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/only-variables-in-MODEL-statements-prior-to-the-first-RUN/m-p/518630#M3595</guid>
      <dc:creator>benepoko</dc:creator>
      <dc:date>2018-12-05T02:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: only variables in MODEL statements prior to the first RUN statement are available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/only-variables-in-MODEL-statements-prior-to-the-first-RUN/m-p/518639#M3596</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC REG DATA=DATASET;
	MODEL Y = X M C1 C2;
	TITLE 'REG OF Y';
run;
PROC REG DATA=DATASET;
	MODEL M = X D E XD XE;
	TITLE 'REG OF M';
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Dec 2018 02:32:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/only-variables-in-MODEL-statements-prior-to-the-first-RUN/m-p/518639#M3596</guid>
      <dc:creator>learsaas</dc:creator>
      <dc:date>2018-12-05T02:32:42Z</dc:date>
    </item>
    <item>
      <title>Re: only variables in MODEL statements prior to the first RUN statement are available</title>
      <link>https://communities.sas.com/t5/New-SAS-User/only-variables-in-MODEL-statements-prior-to-the-first-RUN/m-p/518656#M3599</link>
      <description>&lt;P&gt;PROC REG is an interactive proc. This means you can continue to submit MODEL statements after the RUN statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC REG also does row wise removal of data when any variable in the VAR or MODEL statement is missing.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It only keeps the variables in the MODEL or VAR statement. So if the variable has not been used in the MODEL or VAR statement before the first RUN it cannot be used in the next step because it may not account for the missing values correctly. Or at least that's my guess as to why it's this way.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can just list all the variables in the VAR statement to get around this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;FONT size="4" color="#FF0000"&gt;&lt;STRONG&gt;*does not work;&lt;/STRONG&gt;&lt;/FONT&gt;
proc reg data=sashelp.cars;
model msrp = invoice cylinders mpg_city mpg_highway;
run;
model msrp = weight invoice cylinders;
run;quit;

&lt;FONT size="5" color="#339966"&gt;&lt;STRONG&gt;*does work;&lt;/STRONG&gt;&lt;/FONT&gt;
proc reg data=sashelp.cars;
var msrp invoice cylinders mpg_city mpg_highway weight;
model msrp = invoice cylinders mpg_city mpg_highway;
run;
model msrp = weight invoice cylinders;
run;quit;
&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/249944"&gt;@benepoko&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,guys,&lt;/P&gt;
&lt;P&gt;Here are my codes,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC REG DATA=DATASET;&lt;/P&gt;
&lt;P&gt;MODEL Y = X M C1 C2;&lt;/P&gt;
&lt;P&gt;TITLE 'REG OF Y';&lt;/P&gt;
&lt;P&gt;RUN;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;MODEL&amp;nbsp;M = X D E XD XE;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;TITLE 'REG OF M';&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;QUIT;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;THE ERROR MESSAGE IN LOG IS"only variables in the VAR statement or in MODEL statements prior to the first RUN statement are available"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is there any wrong in my codes?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 03:26:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/only-variables-in-MODEL-statements-prior-to-the-first-RUN/m-p/518656#M3599</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-12-05T03:26:07Z</dc:date>
    </item>
  </channel>
</rss>

