<?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 limit observations and delete rows using one statement? in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308617#M1428</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/110746"&gt;@xiaolufan&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;i was tried to add the quotes, but there is another error that is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="sasError"&gt;ERROR: Variable V103 has been defined as both character and numeric.&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Look at your data. If V103 is numeric, it makes no sense comparing it to the string "self".&lt;/P&gt;
&lt;P&gt;Use proc contents on the input dataset(s).&lt;/P&gt;</description>
    <pubDate>Tue, 01 Nov 2016 20:05:57 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-11-01T20:05:57Z</dc:date>
    <item>
      <title>how to limit observations and delete rows using one statement?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308580#M1421</link>
      <description>&lt;P&gt;I am using University Edition, and tried to limit observations in line 78.&lt;/P&gt;&lt;P&gt;I just want to have the output which only contains the "self" in variable V103.&lt;/P&gt;&lt;P&gt;and also want to drop rows, do I have to write down each row name, or is there any convenience way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my log file.&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;&lt;DIV&gt;&lt;DIV class="sasSource"&gt;61 proc import out=dataset3&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;62 datafile= '/folders/myfolders/Project/09836-0003-Data.'&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;63 dbms=sav&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;64 replace;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;65&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The import data set has 31827 observations and 89 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: WORK.DATASET3 data set was successfully created.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.36 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.24 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;66 data dataset3;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;67 set dataset3;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;68 NEWUCODE=input(UCODE,best32.);&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;69 drop UCODE;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;70 rename NEWUCODE=UCODE;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;71&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;68:16&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 31827 observations read from the data set WORK.DATASET3.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set WORK.DATASET3 has 31827 observations and 89 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.09 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.09 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;72 data dataset3;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;73 retain UCODE V103 V104;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;74 set dataset3;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;75&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 31827 observations read from the data set WORK.DATASET3.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set WORK.DATASET3 has 31827 observations and 89 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.09 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.08 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76 data dataset3;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;77 set dataset3;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;78 if V103 ne self then delete;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;79&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: Variable self is uninitialized.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 31827 observations read from the data set WORK.DATASET3.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set WORK.DATASET3 has 68 observations and 90 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.05 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.04 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;80 data dataset3;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;81 drop V108 V116 V117 V201 V202 V203 V207 V210 V211 V212 V216 V217 V218 V221 V221A;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;82 set dataset3;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;83&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;84&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 68 observations read from the data set WORK.DATASET3.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The data set WORK.DATASET3 has 68 observations and 75 variables.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.03 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.02 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;85 proc means;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;86 run;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 68 observations read from the data set WORK.DATASET3.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE MEANS used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.30 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.30 seconds&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Nov 2016 18:08:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308580#M1421</guid>
      <dc:creator>xiaolufan</dc:creator>
      <dc:date>2016-11-01T18:08:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to limit observations and delete rows using one statement?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308584#M1422</link>
      <description>&lt;P&gt;Without quotes, SAS assumes that self is the name of a variable. Character literals must be enclosed in single or double quotes.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 18:26:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308584#M1422</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-01T18:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to limit observations and delete rows using one statement?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308585#M1423</link>
      <description>&lt;P&gt;i was tried to add the quotes, but there is another error that is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasError"&gt;ERROR: Variable V103 has been defined as both character and numeric.&lt;/DIV&gt;</description>
      <pubDate>Tue, 01 Nov 2016 18:29:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308585#M1423</guid>
      <dc:creator>xiaolufan</dc:creator>
      <dc:date>2016-11-01T18:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: how to limit observations and delete rows using one statement?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308586#M1424</link>
      <description>&lt;P&gt;You can just replace line 78 with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if V103='Self';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 18:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308586#M1424</guid>
      <dc:creator>rcrs2</dc:creator>
      <dc:date>2016-11-01T18:31:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to limit observations and delete rows using one statement?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308587#M1425</link>
      <description>it still shows that ERROR: Variable V103 has been defined as both character and numeric.</description>
      <pubDate>Tue, 01 Nov 2016 18:32:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308587#M1425</guid>
      <dc:creator>xiaolufan</dc:creator>
      <dc:date>2016-11-01T18:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to limit observations and delete rows using one statement?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308591#M1426</link>
      <description>&lt;P&gt;Try using the put() function to transform V103 into a string&amp;nbsp;variable. I find a solution to that error in the following URL:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/td-p/81482" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/Variable-has-been-defined-as-both-character-and-numeric/td-p/81482&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 18:36:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308591#M1426</guid>
      <dc:creator>rcrs2</dc:creator>
      <dc:date>2016-11-01T18:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to limit observations and delete rows using one statement?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308617#M1428</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/110746"&gt;@xiaolufan&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;i was tried to add the quotes, but there is another error that is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="sasError"&gt;ERROR: Variable V103 has been defined as both character and numeric.&lt;/DIV&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Look at your data. If V103 is numeric, it makes no sense comparing it to the string "self".&lt;/P&gt;
&lt;P&gt;Use proc contents on the input dataset(s).&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2016 20:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/how-to-limit-observations-and-delete-rows-using-one-statement/m-p/308617#M1428</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-11-01T20:05:57Z</dc:date>
    </item>
  </channel>
</rss>

