<?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 I have issue recoding some variables. The table just shows points and not my data. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/I-have-issue-recoding-some-variables-The-table-just-shows-points/m-p/507921#M1550</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the code for the table the variables:&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;w1evsmk&amp;nbsp; &amp;nbsp; &amp;nbsp;w1evdrk&amp;nbsp; &amp;nbsp; &amp;nbsp;w1_hgt_in&amp;nbsp;&amp;nbsp;w1cursmk don't show the data and instead, it just shows points (.). What I am doing wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA work.lab1;&lt;BR /&gt;SET saslab.da21600p1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If H1TO1 = 1 and H1TO2 ^= 0 then w1evsmk=1;&lt;BR /&gt;else if H1TO1 = 0 or H1TO2 = 0 then w1evsmk=0;&lt;BR /&gt;label w1evsmk = Wave 1 - ever smoked a whole cigarette;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if H1TO3 = 1 then dailysmkev=1;&lt;BR /&gt;else if H1TO3=0 or ne 6 then dailysmkev=0;&lt;BR /&gt;label dailysmkev = ever smoked daily for at least 30 days;&lt;/P&gt;&lt;P&gt;if w1evsmk=1 then do;&lt;BR /&gt;if H1TO5 ge 1 and H1TO5 lt 32 then days_smk=h1TO5;&lt;/P&gt;&lt;P&gt;label days_smk = number of days smoked in past month among ever smokers;&lt;/P&gt;&lt;P&gt;if H1TO7 lt 90 then num_cigs = H1TO7;&lt;BR /&gt;label num_cigs = number cigarettes per day in past 30 days;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if w1evsmk = 1 and days_smk gt 0 then w1cursmk=2;&lt;BR /&gt;else if w1evsmk = 1 then w1cursmk=1;&lt;BR /&gt;else if w1evsmk = 0 then w1cursmk=0;&lt;BR /&gt;label w1cursmk = current, former, or never smoker;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if h1to12 =1 then w1evdrk=1;&lt;BR /&gt;else if h1to12=0 then w1evdrk=0;&lt;BR /&gt;label w1evdrk = Wave 1 - ever had more than 2-3 drinks;&lt;/P&gt;&lt;P&gt;if h1to30 in (0) then w1evmj=0;&lt;BR /&gt;else if h1to30 not in (96, 99) then w1evmj=1;&lt;BR /&gt;label w1evmj = Wave 1 - ever tried marijuana;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if h1to34 = 0 then w1evcocaine=0;&lt;BR /&gt;else if h1to34 not in (96, 99) then w1evcocaine = 1;&lt;BR /&gt;label w1evcocaine = Wave 1 - ever tried cocaine;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if pa56 = 1 then poverty=0;&lt;BR /&gt;else if pa56=0 then poverty=1;&lt;BR /&gt;label poverty = parent reported not enough money to pay bills;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if w1_hgt_in=(H1GH59A*12) + H1GH59B;&lt;BR /&gt;LABEL w1_hgt_in = total height in inches at Wave 1;&lt;/P&gt;&lt;P&gt;if H1GH60 le 360 then w1_wgt = H1GH60;&lt;BR /&gt;LABEL w1_wgt = Self-reported weight in lbs at Wave 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;keep AID w1evsmk w1evdrk w1evmj w1_hgt_in w1_wgt w1cursmk ethrace male;&lt;BR /&gt;END;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC FREQ DATA=work.lab1;&lt;BR /&gt;Tables w1evsmk w1evdrk w1_hgt_in ethrace w1cursmk / list missprint;&lt;BR /&gt;FORMAT ethrace;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 27 Oct 2018 00:04:52 GMT</pubDate>
    <dc:creator>viancapole</dc:creator>
    <dc:date>2018-10-27T00:04:52Z</dc:date>
    <item>
      <title>I have issue recoding some variables. The table just shows points and not my data.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-have-issue-recoding-some-variables-The-table-just-shows-points/m-p/507921#M1550</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I run the code for the table the variables:&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;w1evsmk&amp;nbsp; &amp;nbsp; &amp;nbsp;w1evdrk&amp;nbsp; &amp;nbsp; &amp;nbsp;w1_hgt_in&amp;nbsp;&amp;nbsp;w1cursmk don't show the data and instead, it just shows points (.). What I am doing wrong?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA work.lab1;&lt;BR /&gt;SET saslab.da21600p1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If H1TO1 = 1 and H1TO2 ^= 0 then w1evsmk=1;&lt;BR /&gt;else if H1TO1 = 0 or H1TO2 = 0 then w1evsmk=0;&lt;BR /&gt;label w1evsmk = Wave 1 - ever smoked a whole cigarette;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if H1TO3 = 1 then dailysmkev=1;&lt;BR /&gt;else if H1TO3=0 or ne 6 then dailysmkev=0;&lt;BR /&gt;label dailysmkev = ever smoked daily for at least 30 days;&lt;/P&gt;&lt;P&gt;if w1evsmk=1 then do;&lt;BR /&gt;if H1TO5 ge 1 and H1TO5 lt 32 then days_smk=h1TO5;&lt;/P&gt;&lt;P&gt;label days_smk = number of days smoked in past month among ever smokers;&lt;/P&gt;&lt;P&gt;if H1TO7 lt 90 then num_cigs = H1TO7;&lt;BR /&gt;label num_cigs = number cigarettes per day in past 30 days;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;if w1evsmk = 1 and days_smk gt 0 then w1cursmk=2;&lt;BR /&gt;else if w1evsmk = 1 then w1cursmk=1;&lt;BR /&gt;else if w1evsmk = 0 then w1cursmk=0;&lt;BR /&gt;label w1cursmk = current, former, or never smoker;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if h1to12 =1 then w1evdrk=1;&lt;BR /&gt;else if h1to12=0 then w1evdrk=0;&lt;BR /&gt;label w1evdrk = Wave 1 - ever had more than 2-3 drinks;&lt;/P&gt;&lt;P&gt;if h1to30 in (0) then w1evmj=0;&lt;BR /&gt;else if h1to30 not in (96, 99) then w1evmj=1;&lt;BR /&gt;label w1evmj = Wave 1 - ever tried marijuana;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if h1to34 = 0 then w1evcocaine=0;&lt;BR /&gt;else if h1to34 not in (96, 99) then w1evcocaine = 1;&lt;BR /&gt;label w1evcocaine = Wave 1 - ever tried cocaine;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if pa56 = 1 then poverty=0;&lt;BR /&gt;else if pa56=0 then poverty=1;&lt;BR /&gt;label poverty = parent reported not enough money to pay bills;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if w1_hgt_in=(H1GH59A*12) + H1GH59B;&lt;BR /&gt;LABEL w1_hgt_in = total height in inches at Wave 1;&lt;/P&gt;&lt;P&gt;if H1GH60 le 360 then w1_wgt = H1GH60;&lt;BR /&gt;LABEL w1_wgt = Self-reported weight in lbs at Wave 1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;keep AID w1evsmk w1evdrk w1evmj w1_hgt_in w1_wgt w1cursmk ethrace male;&lt;BR /&gt;END;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC FREQ DATA=work.lab1;&lt;BR /&gt;Tables w1evsmk w1evdrk w1_hgt_in ethrace w1cursmk / list missprint;&lt;BR /&gt;FORMAT ethrace;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Oct 2018 00:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-have-issue-recoding-some-variables-The-table-just-shows-points/m-p/507921#M1550</guid>
      <dc:creator>viancapole</dc:creator>
      <dc:date>2018-10-27T00:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: I have issue recoding some variables. The table just shows points and not my data.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-have-issue-recoding-some-variables-The-table-just-shows-points/m-p/507922#M1551</link>
      <description>&lt;P&gt;should labels have quotes?&lt;/P&gt;&lt;P&gt;do you need to declare the variables w1evsmk w1evdrk and such.&lt;/P&gt;&lt;P&gt;If you post data in the form of a data step so that the variables formats are&amp;nbsp;known it would be a lot easier to assist you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Oct 2018 01:04:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-have-issue-recoding-some-variables-The-table-just-shows-points/m-p/507922#M1551</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2018-10-27T01:04:02Z</dc:date>
    </item>
    <item>
      <title>Re: I have issue recoding some variables. The table just shows points and not my data.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/I-have-issue-recoding-some-variables-The-table-just-shows-points/m-p/507930#M1554</link>
      <description>&lt;P&gt;Of course, we are only guessing.&amp;nbsp; But here are a few reasonable guesses.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, did you actually read the log to see whether there were any important messages?&amp;nbsp; At a minimum, the issue that&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122002"&gt;@VDD&lt;/a&gt;&amp;nbsp;mentioned about labels being in quotes comes to mind.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Secondly, the logic is probably off.&amp;nbsp; It looks like you got a message about needing a matching END statement, and just stuck one in at the end of the program to remove the error.&amp;nbsp; But that doesn't make the logic correct.&amp;nbsp; More likely, it should be placed much closer to the DO statement.&amp;nbsp; As it stands now, most of your DATA step executes only when w1evsmk=1 ... since that never happens, it is no surprise that your other new variables are always missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, there's no evidence that you actually examined the data to see whether the results are correct.&amp;nbsp; You run a PROC FREQ at the end.&amp;nbsp; How about adding:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tables H1TO1 * H1TO2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you would have some basis to see whether results for W1EVSMK are correct or not.&lt;/P&gt;</description>
      <pubDate>Sat, 27 Oct 2018 02:25:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/I-have-issue-recoding-some-variables-The-table-just-shows-points/m-p/507930#M1554</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-27T02:25:46Z</dc:date>
    </item>
  </channel>
</rss>

