<?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: DELETE statement executed, observation still written to dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263389#M269208</link>
    <description>&lt;P&gt;I think it's because you have a second input after the delete statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to conditionally input a line you need to change the logic to if VAR GE 2 then input the remaining records.&lt;/P&gt;
&lt;P&gt;See a sample here under Full Code.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/45/289.html" target="_blank"&gt;http://support.sas.com/kb/45/289.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or add the delete after your second input statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's an order of operations idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. Please only include the relevant code, log and output. It's hard to parse through that many pages to figure out what's going on. &amp;nbsp;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2016 03:38:34 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-04-13T03:38:34Z</dc:date>
    <item>
      <title>DELETE statement executed, observation still written to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263386#M269207</link>
      <description>&lt;P&gt;The IF statement should be removing the current observation less than 2 from the dataset. &amp;nbsp;That is not happening&lt;/P&gt;&lt;P&gt;===============================================&lt;/P&gt;&lt;P&gt;===============================================&lt;/P&gt;&lt;P&gt;FILENAME XR '/folders/myfolders/Data.txt' LRECL=29;&lt;/P&gt;&lt;P&gt;DATA WORK;&lt;BR /&gt;INFILE XR MISSOVER;&lt;BR /&gt;INPUT XRPKLR @;&lt;BR /&gt;&lt;BR /&gt;IF XRPKLR LT 2 THEN DELETE;&lt;BR /&gt;LENGTH&lt;BR /&gt;SEQN 7&lt;BR /&gt;XRPKLR 8&lt;BR /&gt;XRPKLL 8&lt;BR /&gt;XRPOMFR 8&lt;BR /&gt;XRPOMFL 8&lt;BR /&gt;XRPOMTR 8&lt;BR /&gt;XRPOMTL 8&lt;BR /&gt;XRPOLFR 8&lt;BR /&gt;XRPOLFL 8&lt;BR /&gt;XRPOLTR 8&lt;BR /&gt;XRPOLTL 8&lt;BR /&gt;XRPSMFR 8&lt;BR /&gt;XRPSMFL 8&lt;BR /&gt;XRPSMTR 8&lt;BR /&gt;XRPSMTL 8&lt;BR /&gt;XRPSLFR 8&lt;BR /&gt;XRPSLFL 8&lt;BR /&gt;XRPSLTR 8&lt;BR /&gt;XRPSLTL 8&lt;BR /&gt;XRPCHOR 8&lt;BR /&gt;XRPCHOL 8&lt;BR /&gt;XRPJRR 8&lt;BR /&gt;XRPJRL 8&lt;BR /&gt;;&lt;BR /&gt;FORMAT&lt;BR /&gt;;&lt;BR /&gt;INPUT&lt;BR /&gt;SEQN 1-5&lt;BR /&gt;XRPKLR 6&lt;BR /&gt;XRPKLL 7&lt;BR /&gt;XRPOMFR 8&lt;BR /&gt;XRPOMFL 9&lt;BR /&gt;XRPOMTR 10&lt;BR /&gt;XRPOMTL 11&lt;BR /&gt;XRPOLFR 12&lt;BR /&gt;XRPOLFL 13&lt;BR /&gt;XRPOLTR 14&lt;BR /&gt;XRPOLTL 15&lt;BR /&gt;XRPSMFR 16&lt;BR /&gt;XRPSMFL 17&lt;BR /&gt;XRPSMTR 18&lt;BR /&gt;XRPSMTL 19&lt;BR /&gt;XRPSLFR 20&lt;BR /&gt;XRPSLFL 21&lt;BR /&gt;XRPSLTR 22&lt;BR /&gt;XRPSLTL 23&lt;BR /&gt;XRPCHOR 24&lt;BR /&gt;XRPCHOL 25&lt;BR /&gt;XRPJRR 26&lt;BR /&gt;XRPJRL 27&lt;BR /&gt;;&lt;BR /&gt;LABEL&lt;BR /&gt;SEQN = "Respondent identification number"&lt;BR /&gt;XRPKLR = "Kellgren-Lawrence score, right knee"&lt;BR /&gt;XRPKLL = "Kellgren-Lawrence score, left knee"&lt;BR /&gt;XRPOMFR = "Osteophyte - medial femoral, right knee"&lt;BR /&gt;XRPOMFL = "Osteophyte - medial femoral, left knee"&lt;BR /&gt;XRPOMTR = "Osteophyte - medial tibial, right knee"&lt;BR /&gt;XRPOMTL = "Osteophyte - medial tibial, left knee"&lt;BR /&gt;XRPOLFR = "Osteophyte - lateral femoral, right knee"&lt;BR /&gt;XRPOLFL = "Osteophyte - lateral femoral, left knee"&lt;BR /&gt;XRPOLTR = "Osteophyte - lateral tibial, right knee"&lt;BR /&gt;XRPOLTL = "Osteophyte - lateral tibial, left knee"&lt;BR /&gt;XRPSMFR = "Sclerosis - medial femoral, right knee"&lt;BR /&gt;XRPSMFL = "Sclerosis - medial femoral, left knee"&lt;BR /&gt;XRPSMTR = "Sclerosis - medial tibial, right knee"&lt;BR /&gt;XRPSMTL = "Sclerosis - medial tibial, left knee"&lt;BR /&gt;XRPSLFR = "Sclerosis - lateral femoral, right knee"&lt;BR /&gt;XRPSLFL = "Sclerosis - lateral femoral, left knee"&lt;BR /&gt;XRPSLTR = "Sclerosis - lateral tibial, right knee"&lt;BR /&gt;XRPSLTL = "Sclerosis - lateral tibial, left knee"&lt;BR /&gt;XRPCHOR = "Chondrocalcinosis - right knee"&lt;BR /&gt;XRPCHOL = "Chondrocalcinosis - left knee"&lt;BR /&gt;XRPJRR = "Joint replacement - right knee"&lt;BR /&gt;XRPJRL = "Joint replacement - left knee"&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;PROC PRINT DATA=WORK;&lt;BR /&gt;RUN;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 03:19:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263386#M269207</guid>
      <dc:creator>fpascal</dc:creator>
      <dc:date>2016-04-13T03:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE statement executed, observation still written to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263389#M269208</link>
      <description>&lt;P&gt;I think it's because you have a second input after the delete statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to conditionally input a line you need to change the logic to if VAR GE 2 then input the remaining records.&lt;/P&gt;
&lt;P&gt;See a sample here under Full Code.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/45/289.html" target="_blank"&gt;http://support.sas.com/kb/45/289.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or add the delete after your second input statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's an order of operations idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS. Please only include the relevant code, log and output. It's hard to parse through that many pages to figure out what's going on. &amp;nbsp;&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;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 03:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263389#M269208</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-13T03:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE statement executed, observation still written to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263404#M269209</link>
      <description>&lt;P&gt;Change&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;IF XRPKLR LT 2 THEN DELETE;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if xrpklr &amp;gt;= 2;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and try it out.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 06:33:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263404#M269209</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-13T06:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE statement executed, observation still written to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263480#M269210</link>
      <description>&lt;P&gt;Perhaps the first INPUT statement should read:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;input XRPKLR 6&amp;nbsp;@;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise, you're getting the value starting at column 1.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 11:41:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263480#M269210</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-04-13T11:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE statement executed, observation still written to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263694#M269211</link>
      <description>This worked. Excellent. I knew this was the answer when I read it.</description>
      <pubDate>Wed, 13 Apr 2016 22:38:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263694#M269211</guid>
      <dc:creator>fpascal</dc:creator>
      <dc:date>2016-04-13T22:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE statement executed, observation still written to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263695#M269212</link>
      <description>thanks for the effort. the user Astounding had the correct answer</description>
      <pubDate>Wed, 13 Apr 2016 22:39:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263695#M269212</guid>
      <dc:creator>fpascal</dc:creator>
      <dc:date>2016-04-13T22:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: DELETE statement executed, observation still written to dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263696#M269213</link>
      <description>Reeza. you have been so helpful to me. thank you but the correct solution was from user Astounding below. Until .....</description>
      <pubDate>Wed, 13 Apr 2016 22:40:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DELETE-statement-executed-observation-still-written-to-dataset/m-p/263696#M269213</guid>
      <dc:creator>fpascal</dc:creator>
      <dc:date>2016-04-13T22:40:17Z</dc:date>
    </item>
  </channel>
</rss>

