<?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 0 observations in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/0-observations/m-p/849775#M37171</link>
    <description>&lt;P&gt;I don't understand why I am getting 0 observations. I don't have an error code so I don't know whats going on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data fram1_temp (rename=(RANDID=subjid));
set lib14.fram1;
run;
data fram2_temp (rename=(totchol=totchol2 sysbp=sysbp2 diabp=diabp2));
set lib14.fram2;
run;
proc sort data=fram1_temp; by subjid;
proc sort data=fram2_temp; by subjid; 
data fram_merge;
merge fram1_temp fram2_temp;
by subjid;
age = (vdate-bdate)/365.25;
diff_tchol = totchol2 - totchol;
ch_tchol = sign(diff_tchol);
if sysbp &amp;gt; 120 and sysbp2 &amp;gt; 120 then both_sbp = 1;
if sysbp =&amp;lt; 120 or sysbp2 =&amp;lt; 120 then both_sbp = 0;
if sysbp = . or sysbp2 = . then both_sbp = .;
if diabp &amp;gt; 90 and diabp2 &amp;gt;90 then both_dpb = 1;
if diabp &amp;lt;= 90 or diabp2 &amp;lt;=90 then bothdbp = 0;
if diabp = . or diabp2 =. then both_dbp = .;
if bothdbp = 1 and both_sbp = 1 then both_elev = 1;
else if both_elev = 0;
If bothdbp = . and both_sbp = . then both_elev = .;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;3    data fram1_temp (rename=(RANDID=subjid));
4    set lib14.fram1;
5    run;

NOTE: There were 4434 observations read from the data set LIB14.FRAM1.
NOTE: The data set WORK.FRAM1_TEMP has 4434 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


6    data fram2_temp (rename=(totchol=totchol2 sysbp=sysbp2 diabp=diabp2));
7    set lib14.fram2;
8    run;

NOTE: There were 4434 observations read from the data set LIB14.FRAM2.
NOTE: The data set WORK.FRAM2_TEMP has 4434 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.01 seconds


9    proc sort data=fram1_temp; by subjid;

NOTE: There were 4434 observations read from the data set WORK.FRAM1_TEMP.
NOTE: The data set WORK.FRAM1_TEMP has 4434 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


10   proc sort data=fram2_temp; by subjid;

NOTE: There were 4434 observations read from the data set WORK.FRAM2_TEMP.
NOTE: The data set WORK.FRAM2_TEMP has 4434 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


11   data fram_merge;
12   merge fram1_temp fram2_temp;
13   by subjid;
14   age = (vdate-bdate)/365.25;
15   diff_tchol = totchol2 - totchol;
16   ch_tchol = sign(diff_tchol);
17   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).
      504 at 14:13   675 at 15:23   675 at 16:12
NOTE: There were 4434 observations read from the data set WORK.FRAM1_TEMP.
NOTE: There were 4434 observations read from the data set WORK.FRAM2_TEMP.
NOTE: The data set WORK.FRAM_MERGE has 4434 observations and 12 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


18   libname lib14 '\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Final Exam';
NOTE: Libref LIB14 was successfully assigned as follows:
      Engine:        V9
      Physical Name: \\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Final Exam
19   run;
20   data fram1_temp (rename=(RANDID=subjid));
21   set lib14.fram1;
22   run;

NOTE: There were 4434 observations read from the data set LIB14.FRAM1.
NOTE: The data set WORK.FRAM1_TEMP has 4434 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


23   data fram2_temp (rename=(totchol=totchol2 sysbp=sysbp2 diabp=diabp2));
24   set lib14.fram2;
25   run;

NOTE: There were 4434 observations read from the data set LIB14.FRAM2.
NOTE: The data set WORK.FRAM2_TEMP has 4434 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


26   proc sort data=fram1_temp; by subjid;

NOTE: There were 4434 observations read from the data set WORK.FRAM1_TEMP.
NOTE: The data set WORK.FRAM1_TEMP has 4434 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


27   proc sort data=fram2_temp; by subjid;

NOTE: There were 4434 observations read from the data set WORK.FRAM2_TEMP.
NOTE: The data set WORK.FRAM2_TEMP has 4434 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


28   data fram_merge;
29   merge fram1_temp fram2_temp;
30   by subjid;
31   age = (vdate-bdate)/365.25;
32   diff_tchol = totchol2 - totchol;
33   ch_tchol = sign(diff_tchol);
34   if sysbp &amp;gt; 120 and sysbp2 &amp;gt; 120 then both_sbp = 1;
35   if sysbp =&amp;lt; 120 or sysbp2 =&amp;lt; 120 then both_sbp = 0;
36   if sysbp = . or sysbp2 = . then both_sbp = .;
37   if diabp &amp;gt; 90 and diabp2 &amp;gt;90 then both_dpb = 1;
38   if diabp &amp;lt;= 90 or diabp2 &amp;lt;=90 then bothdbp = 0;
39   if diabp = . or diabp2 =. then both_dbp = .;
40   if bothdbp = 1 and both_sbp = 1 then both_elev = 1;
41   else if both_elev = 0;
42   If bothdbp = . and both_sbp = . then both_elev = .;
43   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).
      504 at 31:13   675 at 32:23   675 at 33:12
NOTE: There were 4434 observations read from the data set WORK.FRAM1_TEMP.
NOTE: There were 4434 observations read from the data set WORK.FRAM2_TEMP.
NOTE: The data set WORK.FRAM_MERGE has 0 observations and 17 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;</description>
    <pubDate>Thu, 15 Dec 2022 02:57:42 GMT</pubDate>
    <dc:creator>MisterJenn</dc:creator>
    <dc:date>2022-12-15T02:57:42Z</dc:date>
    <item>
      <title>0 observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/0-observations/m-p/849775#M37171</link>
      <description>&lt;P&gt;I don't understand why I am getting 0 observations. I don't have an error code so I don't know whats going on.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data fram1_temp (rename=(RANDID=subjid));
set lib14.fram1;
run;
data fram2_temp (rename=(totchol=totchol2 sysbp=sysbp2 diabp=diabp2));
set lib14.fram2;
run;
proc sort data=fram1_temp; by subjid;
proc sort data=fram2_temp; by subjid; 
data fram_merge;
merge fram1_temp fram2_temp;
by subjid;
age = (vdate-bdate)/365.25;
diff_tchol = totchol2 - totchol;
ch_tchol = sign(diff_tchol);
if sysbp &amp;gt; 120 and sysbp2 &amp;gt; 120 then both_sbp = 1;
if sysbp =&amp;lt; 120 or sysbp2 =&amp;lt; 120 then both_sbp = 0;
if sysbp = . or sysbp2 = . then both_sbp = .;
if diabp &amp;gt; 90 and diabp2 &amp;gt;90 then both_dpb = 1;
if diabp &amp;lt;= 90 or diabp2 &amp;lt;=90 then bothdbp = 0;
if diabp = . or diabp2 =. then both_dbp = .;
if bothdbp = 1 and both_sbp = 1 then both_elev = 1;
else if both_elev = 0;
If bothdbp = . and both_sbp = . then both_elev = .;
run; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;3    data fram1_temp (rename=(RANDID=subjid));
4    set lib14.fram1;
5    run;

NOTE: There were 4434 observations read from the data set LIB14.FRAM1.
NOTE: The data set WORK.FRAM1_TEMP has 4434 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


6    data fram2_temp (rename=(totchol=totchol2 sysbp=sysbp2 diabp=diabp2));
7    set lib14.fram2;
8    run;

NOTE: There were 4434 observations read from the data set LIB14.FRAM2.
NOTE: The data set WORK.FRAM2_TEMP has 4434 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.01 seconds


9    proc sort data=fram1_temp; by subjid;

NOTE: There were 4434 observations read from the data set WORK.FRAM1_TEMP.
NOTE: The data set WORK.FRAM1_TEMP has 4434 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


10   proc sort data=fram2_temp; by subjid;

NOTE: There were 4434 observations read from the data set WORK.FRAM2_TEMP.
NOTE: The data set WORK.FRAM2_TEMP has 4434 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


11   data fram_merge;
12   merge fram1_temp fram2_temp;
13   by subjid;
14   age = (vdate-bdate)/365.25;
15   diff_tchol = totchol2 - totchol;
16   ch_tchol = sign(diff_tchol);
17   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).
      504 at 14:13   675 at 15:23   675 at 16:12
NOTE: There were 4434 observations read from the data set WORK.FRAM1_TEMP.
NOTE: There were 4434 observations read from the data set WORK.FRAM2_TEMP.
NOTE: The data set WORK.FRAM_MERGE has 4434 observations and 12 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


18   libname lib14 '\\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Final Exam';
NOTE: Libref LIB14 was successfully assigned as follows:
      Engine:        V9
      Physical Name: \\apporto.com\dfs\GWU\Users\kennedyhinnant_gwu\Downloads\Final Exam
19   run;
20   data fram1_temp (rename=(RANDID=subjid));
21   set lib14.fram1;
22   run;

NOTE: There were 4434 observations read from the data set LIB14.FRAM1.
NOTE: The data set WORK.FRAM1_TEMP has 4434 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


23   data fram2_temp (rename=(totchol=totchol2 sysbp=sysbp2 diabp=diabp2));
24   set lib14.fram2;
25   run;

NOTE: There were 4434 observations read from the data set LIB14.FRAM2.
NOTE: The data set WORK.FRAM2_TEMP has 4434 observations and 5 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.01 seconds


26   proc sort data=fram1_temp; by subjid;

NOTE: There were 4434 observations read from the data set WORK.FRAM1_TEMP.
NOTE: The data set WORK.FRAM1_TEMP has 4434 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.00 seconds


27   proc sort data=fram2_temp; by subjid;

NOTE: There were 4434 observations read from the data set WORK.FRAM2_TEMP.
NOTE: The data set WORK.FRAM2_TEMP has 4434 observations and 5 variables.
NOTE: PROCEDURE SORT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


28   data fram_merge;
29   merge fram1_temp fram2_temp;
30   by subjid;
31   age = (vdate-bdate)/365.25;
32   diff_tchol = totchol2 - totchol;
33   ch_tchol = sign(diff_tchol);
34   if sysbp &amp;gt; 120 and sysbp2 &amp;gt; 120 then both_sbp = 1;
35   if sysbp =&amp;lt; 120 or sysbp2 =&amp;lt; 120 then both_sbp = 0;
36   if sysbp = . or sysbp2 = . then both_sbp = .;
37   if diabp &amp;gt; 90 and diabp2 &amp;gt;90 then both_dpb = 1;
38   if diabp &amp;lt;= 90 or diabp2 &amp;lt;=90 then bothdbp = 0;
39   if diabp = . or diabp2 =. then both_dbp = .;
40   if bothdbp = 1 and both_sbp = 1 then both_elev = 1;
41   else if both_elev = 0;
42   If bothdbp = . and both_sbp = . then both_elev = .;
43   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).
      504 at 31:13   675 at 32:23   675 at 33:12
NOTE: There were 4434 observations read from the data set WORK.FRAM1_TEMP.
NOTE: There were 4434 observations read from the data set WORK.FRAM2_TEMP.
NOTE: The data set WORK.FRAM_MERGE has 0 observations and 17 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 15 Dec 2022 02:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/0-observations/m-p/849775#M37171</guid>
      <dc:creator>MisterJenn</dc:creator>
      <dc:date>2022-12-15T02:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: 0 observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/0-observations/m-p/849780#M37172</link>
      <description>&lt;P&gt;See the statement I've marked that is causing the 0 rows. I think you mean't just ELSE not ELSE IF:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data fram_merge;
merge fram1_temp fram2_temp;
by subjid;
age = (vdate-bdate)/365.25;
diff_tchol = totchol2 - totchol;
ch_tchol = sign(diff_tchol);
if sysbp &amp;gt; 120 and sysbp2 &amp;gt; 120 then both_sbp = 1;
if sysbp =&amp;lt; 120 or sysbp2 =&amp;lt; 120 then both_sbp = 0;
if sysbp = . or sysbp2 = . then both_sbp = .;
if diabp &amp;gt; 90 and diabp2 &amp;gt;90 then both_dpb = 1;
if diabp &amp;lt;= 90 or diabp2 &amp;lt;=90 then bothdbp = 0;
if diabp = . or diabp2 =. then both_dbp = .;
if bothdbp = 1 and both_sbp = 1 then both_elev = 1;
else if both_elev = 0; * This statement is filtering all rows, remov word IF ;
If bothdbp = . and both_sbp = . then both_elev = .;
run; &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Dec 2022 03:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/0-observations/m-p/849780#M37172</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-12-15T03:16:35Z</dc:date>
    </item>
  </channel>
</rss>

