<?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 Temporary Data set - no observations in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836520#M36071</link>
    <description>&lt;P&gt;I am trying to create a temporary data set with smokers only (currentsmoker) in it. It says no observations so I know the code is not correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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; 
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 fit1tmp_smoke;
set hw3.Fit2;
if CURRENTSMOKER = 1;
run;
proc sgplot data=fit1tmp_smoke;
vbox cobmd/group=tx; 
run;&lt;/PRE&gt;&lt;PRE&gt;120  libname hw3 '\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Week 3';
NOTE: Libref HW3 was successfully assigned as follows:
      Engine:        V9
      Physical Name: \\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Week 3
121  data fit1temp;
122  set hw3.fit2;
123  if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
124  else if upcase(compress(smoke)) = "NONSMOKER" or
125  upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
126  if blvfx = "yes" or blnspfx = "yes" then any_base_frac = 1;
127  else if blvfx = "no" and blnspfx = "no" then any_base_frac = 0;
128  if newvfx = "yes" and newnspfx = "yes" then any_new_frac = 1;
129  else if newvfx = "no" and newnspfx = "no" then any_new_frac = 0;
130  if bmi &amp;gt; 25 then bmi2 = "overweight";
131  else if 0 &amp;lt; bmi &amp;lt;= 25 then bmi2 = "normal";
132  if 0 &amp;lt; bmi &amp;lt;= 18 then bmi3 = "underweight";
133  else if 18 &amp;lt; bmi &amp;lt;= 25 then bmi3 = "normal";
134  else if bmi &amp;gt; 25 then bmi3 = "overweight";
135  bmi1_ind = (bmi &amp;gt; 25);
136  bmi2_ind = (18 &amp;lt; bmi &amp;lt;= 25);
137  bmi3_ind = (0 &amp;lt; bmi &amp;lt;= 18);
138  i_tx = (tx = "Alendronate");
139  diff_bmd = cobmd-blbmd;
140  age = (dov - dob)/365.25;
141  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 139: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


142  proc sgplot data=fit1temp;
143  vbox cobmd/group=tx;
144  run;

NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.17 seconds
      cpu time            0.07 seconds

NOTE: There were 5580 observations read from the data set WORK.FIT1TEMP.

145  proc means data=fit1temp mean median std p25 p75;
146  class tx;
147  var cobmd;
148  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


149  proc ttest data=fit1temp;
150  class tx;
151  var cobmd;
152  run;

NOTE: PROCEDURE TTEST used (Total process time):
      real time           1.25 seconds
      cpu time            0.76 seconds


153  data fit1tmp_smoke;
154  set hw3.Fit2;
155  if CURRENTSMOKER = 1;
156  run;

NOTE: Variable CURRENTSMOKER is uninitialized.
NOTE: There were 5580 observations read from the data set HW3.FIT2.
NOTE: The data set WORK.FIT1TMP_SMOKE has 0 observations and 12 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


157  proc sgplot data=fit1tmp_smoke;
158  vbox cobmd/group=tx;
159  run;

NOTE: There were 0 observations read from the data set.
NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Oct 2022 14:45:21 GMT</pubDate>
    <dc:creator>MisterJenn</dc:creator>
    <dc:date>2022-10-03T14:45:21Z</dc:date>
    <item>
      <title>Temporary Data set - no observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836520#M36071</link>
      <description>&lt;P&gt;I am trying to create a temporary data set with smokers only (currentsmoker) in it. It says no observations so I know the code is not correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&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; 
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 fit1tmp_smoke;
set hw3.Fit2;
if CURRENTSMOKER = 1;
run;
proc sgplot data=fit1tmp_smoke;
vbox cobmd/group=tx; 
run;&lt;/PRE&gt;&lt;PRE&gt;120  libname hw3 '\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Week 3';
NOTE: Libref HW3 was successfully assigned as follows:
      Engine:        V9
      Physical Name: \\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Week 3
121  data fit1temp;
122  set hw3.fit2;
123  if upcase(compress(smoke)) = "CURRENTSMOKER" then currentsmoker = 1;
124  else if upcase(compress(smoke)) = "NONSMOKER" or
125  upcase(compress(smoke)) = "FORMERSMOKER" then currentsmoker = 0;
126  if blvfx = "yes" or blnspfx = "yes" then any_base_frac = 1;
127  else if blvfx = "no" and blnspfx = "no" then any_base_frac = 0;
128  if newvfx = "yes" and newnspfx = "yes" then any_new_frac = 1;
129  else if newvfx = "no" and newnspfx = "no" then any_new_frac = 0;
130  if bmi &amp;gt; 25 then bmi2 = "overweight";
131  else if 0 &amp;lt; bmi &amp;lt;= 25 then bmi2 = "normal";
132  if 0 &amp;lt; bmi &amp;lt;= 18 then bmi3 = "underweight";
133  else if 18 &amp;lt; bmi &amp;lt;= 25 then bmi3 = "normal";
134  else if bmi &amp;gt; 25 then bmi3 = "overweight";
135  bmi1_ind = (bmi &amp;gt; 25);
136  bmi2_ind = (18 &amp;lt; bmi &amp;lt;= 25);
137  bmi3_ind = (0 &amp;lt; bmi &amp;lt;= 18);
138  i_tx = (tx = "Alendronate");
139  diff_bmd = cobmd-blbmd;
140  age = (dov - dob)/365.25;
141  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 139: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


142  proc sgplot data=fit1temp;
143  vbox cobmd/group=tx;
144  run;

NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.17 seconds
      cpu time            0.07 seconds

NOTE: There were 5580 observations read from the data set WORK.FIT1TEMP.

145  proc means data=fit1temp mean median std p25 p75;
146  class tx;
147  var cobmd;
148  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


149  proc ttest data=fit1temp;
150  class tx;
151  var cobmd;
152  run;

NOTE: PROCEDURE TTEST used (Total process time):
      real time           1.25 seconds
      cpu time            0.76 seconds


153  data fit1tmp_smoke;
154  set hw3.Fit2;
155  if CURRENTSMOKER = 1;
156  run;

NOTE: Variable CURRENTSMOKER is uninitialized.
NOTE: There were 5580 observations read from the data set HW3.FIT2.
NOTE: The data set WORK.FIT1TMP_SMOKE has 0 observations and 12 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


157  proc sgplot data=fit1tmp_smoke;
158  vbox cobmd/group=tx;
159  run;

NOTE: There were 0 observations read from the data set.
NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 14:45:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836520#M36071</guid>
      <dc:creator>MisterJenn</dc:creator>
      <dc:date>2022-10-03T14:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Temporary Data set - no observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836522#M36072</link>
      <description>&lt;PRE&gt;153  data fit1tmp_smoke;
154  set hw3.Fit2;
155  if CURRENTSMOKER = 1;
156  run;

NOTE: Variable CURRENTSMOKER is uninitialized.&lt;/PRE&gt;
&lt;P&gt;There is no variable CURRENTSMOKER in your dataset hw3.fit2, so the test for it fails.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 14:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836522#M36072</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-03T14:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Temporary Data set - no observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836523#M36073</link>
      <description>&lt;PRE&gt;153  data fit1tmp_smoke;
154  set hw3.Fit2;
155  if CURRENTSMOKER = 1;
156  run;

NOTE: Variable CURRENTSMOKER is uninitialized.
NOTE: There were 5580 observations read from the data set HW3.FIT2.
NOTE: The data set WORK.FIT1TMP_SMOKE has 0 observations and 12 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are zero observations in FIT1TMP_SMOKE, because you don't have a variable named CURRENTSMOKER in the data set HW3.FIT2, that's what the NOTE: is telling you, the variable is uninitialized. Since the variable doesn't exist, it is never equal to 1, and so no observations are sent to FIT1TMP_SMOKE.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 14:52:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836523#M36073</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-03T14:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Temporary Data set - no observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836524#M36074</link>
      <description>&lt;P&gt;But you have created a variable currentsmoker in dataset work.fit1temp. Maybe you work with the wrong dataset here?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 14:52:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836524#M36074</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-03T14:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Temporary Data set - no observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836525#M36075</link>
      <description>&lt;P&gt;The variable &lt;STRONG&gt;currentsmoker&lt;/STRONG&gt; is created in the data set called &lt;STRONG&gt;fit1temp&lt;/STRONG&gt;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The filter is applied to the input data set &lt;STRONG&gt;hw3.fit2&lt;/STRONG&gt; where the &lt;STRONG&gt;currentsmoker&lt;/STRONG&gt; variable does not exist, therefore you get an error message of&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;NOTE: Variable CURRENTSMOKER is uninitialized.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ensure you're referencing the correct data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 14:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Temporary-Data-set-no-observations/m-p/836525#M36075</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-03T14:53:38Z</dc:date>
    </item>
  </channel>
</rss>

