<?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 How  coding to keep drop data? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-coding-to-keep-drop-data/m-p/801540#M33227</link>
    <description>&lt;P&gt;I'm a student and taking SAS course with intensive project work. While I was working on SAS proc correlation and proc regression, I tried to drop some variable using the following code and by SAS project variables not appear after I tried this code. How Can I keep them back?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; work.my_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call streaminit(&lt;STRONG&gt;123&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = &lt;STRONG&gt;1&lt;/STRONG&gt; to &lt;STRONG&gt;1000&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_var = rand("Normal", &lt;STRONG&gt;0&lt;/STRONG&gt;, &lt;STRONG&gt;1&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop i;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Mar 2022 22:55:12 GMT</pubDate>
    <dc:creator>Amex1</dc:creator>
    <dc:date>2022-03-10T22:55:12Z</dc:date>
    <item>
      <title>How  coding to keep drop data?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-coding-to-keep-drop-data/m-p/801540#M33227</link>
      <description>&lt;P&gt;I'm a student and taking SAS course with intensive project work. While I was working on SAS proc correlation and proc regression, I tried to drop some variable using the following code and by SAS project variables not appear after I tried this code. How Can I keep them back?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data&lt;/STRONG&gt; work.my_data;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call streaminit(&lt;STRONG&gt;123&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i = &lt;STRONG&gt;1&lt;/STRONG&gt; to &lt;STRONG&gt;1000&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; my_var = rand("Normal", &lt;STRONG&gt;0&lt;/STRONG&gt;, &lt;STRONG&gt;1&lt;/STRONG&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop i;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 22:55:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-coding-to-keep-drop-data/m-p/801540#M33227</guid>
      <dc:creator>Amex1</dc:creator>
      <dc:date>2022-03-10T22:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: How  coding to keep drop data?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-coding-to-keep-drop-data/m-p/801550#M33228</link>
      <description>&lt;P&gt;Drop does just that, drops the variable(s) from the output (or if used as a data set option before the data is brought into the data vector).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where do&amp;nbsp; you want the variable? If it is to be in the same data set then remove the drop statement.&lt;/P&gt;
&lt;P&gt;If you want multiple data sets, one with and one without the "dropped" variable you can do so at creation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.my_data (drop=i)
     work.datawithdrop
;
   call streaminit(123);

   do i = 1 to 1000;
      my_var = rand("Normal", 0, 1);
      output;
   end;
run;&lt;/PRE&gt;
&lt;P&gt;The two data set names on the DATA statement means data may be written to both. In this case all the records will be written to both data sets. The first data set uses the option to drop the variable i when records are written to it.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2022 23:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-coding-to-keep-drop-data/m-p/801550#M33228</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-03-10T23:34:37Z</dc:date>
    </item>
  </channel>
</rss>

