<?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 Need to change second observation (on same date/ID) from 1 to 0 in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Need-to-change-second-observation-on-same-date-ID-from-1-to-0/m-p/620718#M19532</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need some help with the following code. The first five columns are vaccinations given, and the last column is a concatenation of ID and date of visit. If someone is given the same vaccine on the same day it shouldn't count twice. Line 1 and line 4 both have Dtap observations, for the same ID/date. I can't delete the 4th observation because there's also a new vaccination there. If a patient has the same vaccine tagged as "1" on the same date, is there any way I can turn that second occurrence to "0"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data SAMPLE;
  infile datalines dsd truncover;
  input DTAP:32. polio:32. MMR:32. HiB:32. HepB:32. ID_VaxDate:$19.;
datalines;
1 1 0 0 1 154548,2015-04-30
0 0 0 0 0 154548,2015-04-30
0 0 0 1 0 154548,2015-04-30
1 0 1 0 0 154548,2015-04-30
0 0 0 0 1 154548,2018-09-04&lt;/PRE&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jan 2020 00:32:23 GMT</pubDate>
    <dc:creator>Amenon</dc:creator>
    <dc:date>2020-01-29T00:32:23Z</dc:date>
    <item>
      <title>Need to change second observation (on same date/ID) from 1 to 0</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-to-change-second-observation-on-same-date-ID-from-1-to-0/m-p/620718#M19532</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I need some help with the following code. The first five columns are vaccinations given, and the last column is a concatenation of ID and date of visit. If someone is given the same vaccine on the same day it shouldn't count twice. Line 1 and line 4 both have Dtap observations, for the same ID/date. I can't delete the 4th observation because there's also a new vaccination there. If a patient has the same vaccine tagged as "1" on the same date, is there any way I can turn that second occurrence to "0"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data SAMPLE;
  infile datalines dsd truncover;
  input DTAP:32. polio:32. MMR:32. HiB:32. HepB:32. ID_VaxDate:$19.;
datalines;
1 1 0 0 1 154548,2015-04-30
0 0 0 0 0 154548,2015-04-30
0 0 0 1 0 154548,2015-04-30
1 0 1 0 0 154548,2015-04-30
0 0 0 0 1 154548,2018-09-04&lt;/PRE&gt;&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 00:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-to-change-second-observation-on-same-date-ID-from-1-to-0/m-p/620718#M19532</guid>
      <dc:creator>Amenon</dc:creator>
      <dc:date>2020-01-29T00:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: Need to change second observation (on same date/ID) from 1 to 0</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-to-change-second-observation-on-same-date-ID-from-1-to-0/m-p/620726#M19533</link>
      <description>&lt;P&gt;Why can't you just reduce it to one observation per id*date?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary nway data=sample;
  class ID_VaxDate;
  var DTAP polio MMR HiB HepB ;
  output out=want max= ;
run;&lt;/CODE&gt;&lt;/PRE&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>Wed, 29 Jan 2020 01:55:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-to-change-second-observation-on-same-date-ID-from-1-to-0/m-p/620726#M19533</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-01-29T01:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need to change second observation (on same date/ID) from 1 to 0</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Need-to-change-second-observation-on-same-date-ID-from-1-to-0/m-p/621021#M19582</link>
      <description>&lt;P&gt;Thank you that works!! I thought it had to be a simple solution but I just couldn't figure out the right googleable terms.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 00:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Need-to-change-second-observation-on-same-date-ID-from-1-to-0/m-p/621021#M19582</guid>
      <dc:creator>Amenon</dc:creator>
      <dc:date>2020-01-30T00:03:49Z</dc:date>
    </item>
  </channel>
</rss>

