<?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: How to delete a dataset line based on date and time? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-a-dataset-line-based-on-date-and-time/m-p/789519#M32410</link>
    <description>Thank you!&lt;BR /&gt;Never thought beyond seconds.. Indeed rounding did the job&lt;BR /&gt;Thanks as well for the line, as I would not have known how to place that in the right order!</description>
    <pubDate>Tue, 11 Jan 2022 16:24:28 GMT</pubDate>
    <dc:creator>joostman2</dc:creator>
    <dc:date>2022-01-11T16:24:28Z</dc:date>
    <item>
      <title>How to delete a dataset line based on date and time?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-a-dataset-line-based-on-date-and-time/m-p/789503#M32406</link>
      <description>&lt;P&gt;I'm quite new to SAS and did some in a dataset which I want to clean.&lt;BR /&gt;I have a dataset as shown below. The record shown is the one I want to delete from the dataset.&lt;/P&gt;&lt;P&gt;I want to get a program to clean my testing, but want it be based on date (datum), time (Tijd) and name (Mailing)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas-example.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67297iA31924238C51BBD6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sas-example.png" alt="sas-example.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I was thinking that below programcode would do the trick&lt;/P&gt;&lt;PRE&gt;DATA Datasettest2;
set Datasettest;
IF MAILING EQ 'ZM0000' AND Datum EQ "11jan2022"d AND Tijd EQ "16:49:24"T THEN DELETE;
RUN;&lt;/PRE&gt;&lt;P&gt;Unfortunately the program runs and the line is still there afterwards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I just search for&amp;nbsp;date (datum) and name (Mailing) it works, but I want to be more specific with a timestamp added to preserve certain lines.&lt;/P&gt;&lt;PRE&gt;DATA Datasettest2;
set Datasettest;
IF MAILING EQ 'ZM0000' AND Datum EQ "11jan2022"d THEN DELETE;
RUN;&lt;/PRE&gt;&lt;P&gt;I am assuming there must me something with the time part as this doesn't work.&amp;nbsp;&lt;BR /&gt;I am specially looking for this time field to match, not to look for alternate solutions based on other fields.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I did a proc content and below is shown from the dataset. Maybe this could help?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas-example3.png" style="width: 377px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67298iE1764C0A906395E7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sas-example3.png" alt="sas-example3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas-example2.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67296i05287D66579079C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="sas-example2.png" alt="sas-example2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sas-example5.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/67303i282548F4BBF17CB7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sas-example5.png" alt="sas-example5.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 16:12:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-delete-a-dataset-line-based-on-date-and-time/m-p/789503#M32406</guid>
      <dc:creator>joostman2</dc:creator>
      <dc:date>2022-01-11T16:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete a dataset line based on date and time?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-a-dataset-line-based-on-date-and-time/m-p/789505#M32407</link>
      <description>&lt;P&gt;Obviously we don't have any of your data.&lt;/P&gt;
&lt;P&gt;Equality is a pretty strong requirement. Depending on how your variable Tijd was created you might have a very small fractional second component that is not displayed with the TIME8. format, or is rounding to seconds. I suggest trying&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;round(Tijd) = "16:49:24"t&lt;/P&gt;
&lt;P&gt;to force an integer number of seconds for comparison&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jan 2022 16:17:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-delete-a-dataset-line-based-on-date-and-time/m-p/789505#M32407</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-11T16:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to delete a dataset line based on date and time?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-delete-a-dataset-line-based-on-date-and-time/m-p/789519#M32410</link>
      <description>Thank you!&lt;BR /&gt;Never thought beyond seconds.. Indeed rounding did the job&lt;BR /&gt;Thanks as well for the line, as I would not have known how to place that in the right order!</description>
      <pubDate>Tue, 11 Jan 2022 16:24:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-delete-a-dataset-line-based-on-date-and-time/m-p/789519#M32410</guid>
      <dc:creator>joostman2</dc:creator>
      <dc:date>2022-01-11T16:24:28Z</dc:date>
    </item>
  </channel>
</rss>

