<?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: Temporary Data Set Error in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836584#M36086</link>
    <description>&lt;P&gt;It's helpful if you continue from your previous post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You shouldn't recreate variables multiple times, it's a waste of resources/programming and if you make a mistake you'll have to fix it in multiple places which is often error prone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would recommend changing your code as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fit1temp_smoke_ovwt;
set fit1temp;

where currentsmoker=1 and bmi2='overweight';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would also recommend changing your previous step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fit1temp_smoke;
set hw3.fit2;
if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
else if upcase(compress(smoke)) = "NONSMOKER" or 
upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
if currentsmoker = 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fit1temp_smoke;
set fit1temp;
where currentsmoker = 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or note that you don't even need to create temporary data sets you can apply the filter to the procs directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title 'Smokers Analysis';
proc sgplot data = fit1temp;
where currentsmoker=1;
vbox cobmd/group=tx;
run;
proc means data=fit1temp mean median std p25 p75;
where currentsmoker=1;
class tx;
var cobmd;
run;
proc npar1way data=fit1temp wilcoxon; 
where currentsmoker=1;
class tx;
var cobmd;
run; 

title 'Smokers &amp;amp; Overweight Analysis';
proc sgplot data = fit1temp;
where currentsmoker=1 and bmi2='overweight';
vbox cobmd/group=tx;
run;
proc means data=fit1temp mean median std p25 p75;
where currentsmoker=1 and bmi2='overweight';
class tx;
var cobmd;
run;
proc npar1way data=fit1temp wilcoxon; 
where currentsmoker=1 and bmi2='overweight';
class tx;
var cobmd;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 03 Oct 2022 19:11:56 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-10-03T19:11:56Z</dc:date>
    <item>
      <title>Temporary Data Set Error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836581#M36083</link>
      <description>&lt;P&gt;I want to make a temporary dataset with smokers who are overweight and who were in the alendronate treatment group. However I keep receiving an error message. What am I doing wrong?&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;libname hw3 '\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Week 3';
data fit1temp;
set hw3.fit2;
if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
else if upcase(compress(smoke)) = "NONSMOKER" or 
upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
if blvfx = "yes" or blnspfx = "yes" then any_base_frac = 1;
else if blvfx = "no" and blnspfx = "no" then any_base_frac = 0;
if newvfx = "yes" and newnspfx = "yes" then any_new_frac = 1; 
else if newvfx = "no" and newnspfx = "no" then any_new_frac = 0;
if bmi &amp;gt; 25 then bmi2 = "overweight"; 
else if 0 &amp;lt; bmi &amp;lt;= 25 then bmi2 = "normal";
if 0 &amp;lt; bmi &amp;lt;= 18 then bmi3 = "underweight";
else if 18 &amp;lt; bmi &amp;lt;= 25 then bmi3 = "normal"; 
else if bmi &amp;gt; 25 then bmi3 = "overweight";
bmi1_ind = (bmi &amp;gt; 25);
bmi2_ind = (18 &amp;lt; bmi &amp;lt;= 25);
bmi3_ind = (0 &amp;lt; bmi &amp;lt;= 18);
i_tx = (tx = "Alendronate");
diff_bmd = cobmd-blbmd;
age = (dov - dob)/365.25;
run; 
data fit1temp_tx;
set hw3.fit2;
if tx = "Alendronate";
run; 
data fit1temp_placebo;
set hw3.Fit2;
if tx = "Placebo";
run;
proc sgplot data=fit1temp;
vbox cobmd/group=tx; 
run;
proc means data=fit1temp mean median std p25 p75;
class tx;
var cobmd;
run;
proc ttest data=fit1temp;
class tx;
var cobmd;
run;
data fit1temp_smoke;
set hw3.fit2;
if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
else if upcase(compress(smoke)) = "NONSMOKER" or 
upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
if currentsmoker = 1;
run;
proc sgplot data = fit1temp_smoke;
vbox cobmd/group=tx;
run;
proc means data=fit1temp_smoke mean median std p25 p75;
class tx;
var cobmd;
run;
proc npar1way data=fit1temp_smoke wilcoxon; 
class tx;
var cobmd;
run; 
data fit1temp_smoke_ovwt;
set hw3.fit2;
if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
else if upcase(compress(smoke)) = "NONSMOKER" or 
upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
if bmi &amp;gt; 25 then bmi2 = "overweight"; 
else if 0 &amp;lt; bmi &amp;lt;= 25 then bmi2 = "normal";
if 0 &amp;lt; bmi &amp;lt;= 18 then bmi3 = "underweight";
else if 18 &amp;lt; bmi &amp;lt;= 25 then bmi3 = "normal"; 
else if bmi &amp;gt; 25 then bmi3 = "overweight";
if currentsmoker = 1; 
if bmi3 = overweight;
diff_bmd = cobmd-blbmd;
proc ttest data fit1temp_smoke_ovwt;
var diff_bmd;
run;&lt;/PRE&gt;&lt;PRE&gt;NOTE: Libref HW3 was successfully assigned as follows:
      Engine:        V9
      Physical Name: \\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Week 3
186  data fit1temp;
187  set hw3.fit2;
188  if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
189  else if upcase(compress(smoke)) = "NONSMOKER" or
190  upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
191  if blvfx = "yes" or blnspfx = "yes" then any_base_frac = 1;
192  else if blvfx = "no" and blnspfx = "no" then any_base_frac = 0;
193  if newvfx = "yes" and newnspfx = "yes" then any_new_frac = 1;
194  else if newvfx = "no" and newnspfx = "no" then any_new_frac = 0;
195  if bmi &amp;gt; 25 then bmi2 = "overweight";
196  else if 0 &amp;lt; bmi &amp;lt;= 25 then bmi2 = "normal";
197  if 0 &amp;lt; bmi &amp;lt;= 18 then bmi3 = "underweight";
198  else if 18 &amp;lt; bmi &amp;lt;= 25 then bmi3 = "normal";
199  else if bmi &amp;gt; 25 then bmi3 = "overweight";
200  bmi1_ind = (bmi &amp;gt; 25);
201  bmi2_ind = (18 &amp;lt; bmi &amp;lt;= 25);
202  bmi3_ind = (0 &amp;lt; bmi &amp;lt;= 18);
203  i_tx = (tx = "Alendronate");
204  diff_bmd = cobmd-blbmd;
205  age = (dov - dob)/365.25;
206  run;

NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      189 at 204:17
NOTE: There were 5580 observations read from the data set HW3.FIT2.
NOTE: The data set WORK.FIT1TEMP has 5580 observations and 22 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.01 seconds


207  data fit1temp_tx;
208  set hw3.fit2;
209  if tx = "Alendronate";
210  run;

NOTE: There were 5580 observations read from the data set HW3.FIT2.
NOTE: The data set WORK.FIT1TEMP_TX has 2678 observations and 11 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.00 seconds


211  data fit1temp_placebo;
212  set hw3.Fit2;
213  if tx = "Placebo";
214  run;

NOTE: There were 5580 observations read from the data set HW3.FIT2.
NOTE: The data set WORK.FIT1TEMP_PLACEBO has 2902 observations and 11 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


215  proc sgplot data=fit1temp;
216  vbox cobmd/group=tx;
217  run;

NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.20 seconds
      cpu time            0.07 seconds

NOTE: There were 5580 observations read from the data set WORK.FIT1TEMP.

218  proc means data=fit1temp mean median std p25 p75;
219  class tx;
220  var cobmd;
221  run;

NOTE: There were 5580 observations read from the data set WORK.FIT1TEMP.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


222  proc ttest data=fit1temp;
223  class tx;
224  var cobmd;
225  run;

NOTE: PROCEDURE TTEST used (Total process time):
      real time           1.34 seconds
      cpu time            0.68 seconds


226  data fit1temp_smoke;
227  set hw3.fit2;
228  if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
229  else if upcase(compress(smoke)) = "NONSMOKER" or
230  upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
231  if currentsmoker = 1;
232  run;

NOTE: There were 5580 observations read from the data set HW3.FIT2.
NOTE: The data set WORK.FIT1TEMP_SMOKE has 599 observations and 12 variables.
NOTE: DATA statement used (Total process time):
      real time           0.07 seconds
      cpu time            0.00 seconds


233  proc sgplot data = fit1temp_smoke;
234  vbox cobmd/group=tx;
235  run;

NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.12 seconds
      cpu time            0.04 seconds

NOTE: There were 599 observations read from the data set WORK.FIT1TEMP_SMOKE.

236  proc means data=fit1temp_smoke mean median std p25 p75;
237  class tx;
238  var cobmd;
239  run;

NOTE: There were 599 observations read from the data set WORK.FIT1TEMP_SMOKE.
NOTE: PROCEDURE MEANS used (Total process time):
      real time           0.04 seconds
      cpu time            0.03 seconds


240  proc npar1way data=fit1temp_smoke wilcoxon;
241  class tx;
242  var cobmd;
243  run;

NOTE: PROCEDURE NPAR1WAY used (Total process time):
      real time           0.29 seconds
      cpu time            0.17 seconds


244  data fit1temp_smoke_ovwt;
245  set hw3.fit2;
246  if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
247  else if upcase(compress(smoke)) = "NONSMOKER" or
248  upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
249  if bmi &amp;gt; 25 then bmi2 = "overweight";
250  else if 0 &amp;lt; bmi &amp;lt;= 25 then bmi2 = "normal";
251  if 0 &amp;lt; bmi &amp;lt;= 18 then bmi3 = "underweight";
252  else if 18 &amp;lt; bmi &amp;lt;= 25 then bmi3 = "normal";
253  else if bmi &amp;gt; 25 then bmi3 = "overweight";
254  if currentsmoker = 1;
255  if bmi3 = overweight;
256  diff_bmd = cobmd-blbmd;

NOTE: Variable overweight is uninitialized.
NOTE: There were 5580 observations read from the data set HW3.FIT2.
NOTE: The data set WORK.FIT1TEMP_SMOKE_OVWT has 0 observations and 16 variables.
NOTE: DATA statement used (Total process time):
      real time           0.09 seconds
      cpu time            0.01 seconds


257  proc ttest data fit1temp_smoke_ovwt;
                     -------------------
                     73
ERROR 73-322: Expecting an =.
258  var diff_bmd;
259  run;

NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE TTEST used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Oct 2022 18:53:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836581#M36083</guid>
      <dc:creator>MisterJenn</dc:creator>
      <dc:date>2022-10-03T18:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Temporary Data Set Error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836582#M36084</link>
      <description>&lt;P&gt;Looks like you need at least two corrections - see comments:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fit1temp_smoke_ovwt;
set hw3.fit2;
if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
else if upcase(compress(smoke)) = "NONSMOKER" or 
upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
if bmi &amp;gt; 25 then bmi2 = "overweight"; 
else if 0 &amp;lt; bmi &amp;lt;= 25 then bmi2 = "normal";
if 0 &amp;lt; bmi &amp;lt;= 18 then bmi3 = "underweight";
else if 18 &amp;lt; bmi &amp;lt;= 25 then bmi3 = "normal"; 
else if bmi &amp;gt; 25 then bmi3 = "overweight";
if currentsmoker = 1; 
&lt;STRONG&gt;if bmi3 = "overweight"; * Quotes required:&lt;/STRONG&gt;
diff_bmd = cobmd-blbmd;
&lt;STRONG&gt;proc ttest data = fit1temp_smoke_ovwt; * Equals sign required;&lt;/STRONG&gt;
var diff_bmd;
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 19:08:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836582#M36084</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-10-03T19:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: Temporary Data Set Error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836583#M36085</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/435394"&gt;@MisterJenn&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I want to make a temporary dataset with smokers who are overweight and who were in the alendronate treatment group. However I keep receiving an error message. What am I doing wrong?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The only error is here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;257  proc ttest data fit1temp_smoke_ovwt;
                     -------------------
                     73
&lt;FONT color="#FF0000"&gt;ERROR 73-322: Expecting an =.&lt;/FONT&gt;
258  var diff_bmd;
259  run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that not self-explanatory?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 19:09:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836583#M36085</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-03T19:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Temporary Data Set Error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836584#M36086</link>
      <description>&lt;P&gt;It's helpful if you continue from your previous post.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You shouldn't recreate variables multiple times, it's a waste of resources/programming and if you make a mistake you'll have to fix it in multiple places which is often error prone.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would recommend changing your code as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fit1temp_smoke_ovwt;
set fit1temp;

where currentsmoker=1 and bmi2='overweight';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would also recommend changing your previous step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fit1temp_smoke;
set hw3.fit2;
if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
else if upcase(compress(smoke)) = "NONSMOKER" or 
upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
if currentsmoker = 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fit1temp_smoke;
set fit1temp;
where currentsmoker = 1;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or note that you don't even need to create temporary data sets you can apply the filter to the procs directly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;title 'Smokers Analysis';
proc sgplot data = fit1temp;
where currentsmoker=1;
vbox cobmd/group=tx;
run;
proc means data=fit1temp mean median std p25 p75;
where currentsmoker=1;
class tx;
var cobmd;
run;
proc npar1way data=fit1temp wilcoxon; 
where currentsmoker=1;
class tx;
var cobmd;
run; 

title 'Smokers &amp;amp; Overweight Analysis';
proc sgplot data = fit1temp;
where currentsmoker=1 and bmi2='overweight';
vbox cobmd/group=tx;
run;
proc means data=fit1temp mean median std p25 p75;
where currentsmoker=1 and bmi2='overweight';
class tx;
var cobmd;
run;
proc npar1way data=fit1temp wilcoxon; 
where currentsmoker=1 and bmi2='overweight';
class tx;
var cobmd;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Oct 2022 19:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836584#M36086</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-03T19:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Temporary Data Set Error</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836585#M36087</link>
      <description>&lt;P&gt;The main thing you are doing wrong is posting the log here, instead of reading it and trying to let it guide you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before you get to the error, the log reports two problems.&amp;nbsp; You have zero observations where CURRENTSMOKER is 1.&amp;nbsp; Perhaps the value of SMOKE that you look for ("CURRENTSMOKER") is spelled incorrectly.&amp;nbsp; But only you can investigate that, nobody here can do that for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you try to use a variable named OVERWEIGHT, but your data doesn't contain such a variable.&amp;nbsp; Again, perhaps it is a matter of correct spelling, but for whatever reason it is not in your data.&amp;nbsp; Once again, only you can investigate that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only error you get is in PROC TTEST, where you omit the equal sign.&amp;nbsp; The log pretty clearly spells that out and tells you how to correct it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 19:13:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-Set-Error/m-p/836585#M36087</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-10-03T19:13:31Z</dc:date>
    </item>
  </channel>
</rss>

